Skip to content

Commit

Permalink
Rename module to v2
Browse files Browse the repository at this point in the history
Signed-off-by: Paulo Gomes <[email protected]>
  • Loading branch information
pjbgf committed Jan 3, 2025
1 parent 52e2133 commit 5629455
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 18 deletions.
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

0 comments on commit 5629455

Please sign in to comment.