Skip to content

Commit 5629455

Browse files
committedJan 3, 2025··
Rename module to v2
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
1 parent 52e2133 commit 5629455

9 files changed

+12
-18
lines changed
 

‎doc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,4 @@
139139
// - error handling
140140
// - make error context accessible programmatically?
141141
// - limit input size?
142-
package gcfg // import "github.com/go-git/gcfg"
142+
package gcfg

‎example_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package gcfg_test
33
import (
44
"fmt"
55
"log"
6-
)
76

8-
import "github.com/go-git/gcfg"
7+
"github.com/go-git/gcfg/v2"
8+
)
99

1010
func ExampleReadStringInto() {
1111
cfgStr := `; Comment line

‎go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/go-git/gcfg
1+
module github.com/go-git/gcfg/v2
22

33
go 1.21

‎read.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"os"
77
"strings"
88

9-
"github.com/go-git/gcfg/scanner"
10-
"github.com/go-git/gcfg/token"
9+
"github.com/go-git/gcfg/v2/scanner"
10+
"github.com/go-git/gcfg/v2/token"
1111
)
1212

1313
var unescape = map[rune]rune{'\\': '\\', '"': '"', 'n': '\n', 't': '\t', 'b': '\b', '\n': '\n'}

‎scanner/errors.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,14 @@ import (
88
"fmt"
99
"io"
1010
"sort"
11-
)
1211

13-
import (
14-
"github.com/go-git/gcfg/token"
12+
"github.com/go-git/gcfg/v2/token"
1513
)
1614

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

3734
// ErrorList is a list of *Errors.
3835
// The zero value for an ErrorList is an empty ErrorList ready to use.
39-
//
4036
type ErrorList []*Error
4137

4238
// Add adds an Error with given position and error message to an ErrorList.
@@ -66,7 +62,6 @@ func (p ErrorList) Less(i, j int) bool {
6662
// Sort sorts an ErrorList. *Error entries are sorted by position,
6763
// other errors are sorted by error message, and before any *Error
6864
// entry.
69-
//
7065
func (p ErrorList) Sort() {
7166
sort.Sort(p)
7267
}
@@ -109,7 +104,6 @@ func (p ErrorList) Err() error {
109104
// PrintError is a utility function that prints a list of errors to w,
110105
// one error per line, if the err parameter is an ErrorList. Otherwise
111106
// it prints the err string.
112-
//
113107
func PrintError(w io.Writer, err error) {
114108
if list, ok := err.(ErrorList); ok {
115109
for _, e := range list {

‎scanner/example_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"fmt"
99
"log"
1010

11-
"github.com/go-git/gcfg/scanner"
12-
"github.com/go-git/gcfg/token"
11+
"github.com/go-git/gcfg/v2/scanner"
12+
"github.com/go-git/gcfg/v2/token"
1313
)
1414

1515
func ExampleScanner_Scan() {

‎scanner/scanner.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"unicode"
1818
"unicode/utf8"
1919

20-
"github.com/go-git/gcfg/token"
20+
"github.com/go-git/gcfg/v2/token"
2121
)
2222

2323
var ErrSourceLenAndSizeMismatch = errors.New("source length and file size mismatch")

‎scanner/scanner_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strings"
1010
"testing"
1111

12-
"github.com/go-git/gcfg/token"
12+
"github.com/go-git/gcfg/v2/token"
1313
)
1414

1515
var fset = token.NewFileSet()

‎set.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"unicode"
1313
"unicode/utf8"
1414

15-
"github.com/go-git/gcfg/types"
15+
"github.com/go-git/gcfg/v2/types"
1616
)
1717

1818
var (

0 commit comments

Comments
 (0)
Please sign in to comment.