Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename module to v2 #6

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@
// - error handling
// - make error context accessible programmatically?
// - limit input size?
package gcfg // import "github.com/go-git/gcfg"
package gcfg
4 changes: 2 additions & 2 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package gcfg_test
import (
"fmt"
"log"
)

import "github.com/go-git/gcfg"
"github.com/go-git/gcfg/v2"
)

func ExampleReadStringInto() {
cfgStr := `; Comment line
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/go-git/gcfg
module github.com/go-git/gcfg/v2

go 1.21
4 changes: 2 additions & 2 deletions read.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"os"
"strings"

"github.com/go-git/gcfg/scanner"
"github.com/go-git/gcfg/token"
"github.com/go-git/gcfg/v2/scanner"
"github.com/go-git/gcfg/v2/token"
)

var unescape = map[rune]rune{'\\': '\\', '"': '"', 'n': '\n', 't': '\t', 'b': '\b', '\n': '\n'}
Expand Down
8 changes: 1 addition & 7 deletions scanner/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ import (
"fmt"
"io"
"sort"
)

import (
"github.com/go-git/gcfg/token"
"github.com/go-git/gcfg/v2/token"
)

// In an ErrorList, an error is represented by an *Error.
// The position Pos, if valid, points to the beginning of
// the offending token, and the error condition is described
// by Msg.
//
type Error struct {
Pos token.Position
Msg string
Expand All @@ -36,7 +33,6 @@ func (e Error) Error() string {

// ErrorList is a list of *Errors.
// The zero value for an ErrorList is an empty ErrorList ready to use.
//
type ErrorList []*Error

// Add adds an Error with given position and error message to an ErrorList.
Expand Down Expand Up @@ -66,7 +62,6 @@ func (p ErrorList) Less(i, j int) bool {
// Sort sorts an ErrorList. *Error entries are sorted by position,
// other errors are sorted by error message, and before any *Error
// entry.
//
func (p ErrorList) Sort() {
sort.Sort(p)
}
Expand Down Expand Up @@ -109,7 +104,6 @@ func (p ErrorList) Err() error {
// PrintError is a utility function that prints a list of errors to w,
// one error per line, if the err parameter is an ErrorList. Otherwise
// it prints the err string.
//
func PrintError(w io.Writer, err error) {
if list, ok := err.(ErrorList); ok {
for _, e := range list {
Expand Down
4 changes: 2 additions & 2 deletions scanner/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"log"

"github.com/go-git/gcfg/scanner"
"github.com/go-git/gcfg/token"
"github.com/go-git/gcfg/v2/scanner"
"github.com/go-git/gcfg/v2/token"
)

func ExampleScanner_Scan() {
Expand Down
2 changes: 1 addition & 1 deletion scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"unicode"
"unicode/utf8"

"github.com/go-git/gcfg/token"
"github.com/go-git/gcfg/v2/token"
)

var ErrSourceLenAndSizeMismatch = errors.New("source length and file size mismatch")
Expand Down
2 changes: 1 addition & 1 deletion scanner/scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"testing"

"github.com/go-git/gcfg/token"
"github.com/go-git/gcfg/v2/token"
)

var fset = token.NewFileSet()
Expand Down
2 changes: 1 addition & 1 deletion set.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"unicode"
"unicode/utf8"

"github.com/go-git/gcfg/types"
"github.com/go-git/gcfg/v2/types"
)

var (
Expand Down
Loading