Skip to content

Commit 87b9f05

Browse files
committed
Fix tests for older Go versions
1 parent 4272474 commit 87b9f05

File tree

5 files changed

+11
-2
lines changed

5 files changed

+11
-2
lines changed

error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
// For example invalid syntax, duplicate keys, etc.
1111
//
1212
// In addition to the error message itself, you can also print detailed location
13-
// information with context by using ErrorWithLocation():
13+
// information with context by using ErrorWithPosition():
1414
//
1515
// toml: error: Key 'fruit' was already created and cannot be used as an array.
1616
//

error_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func TestParseError(t *testing.T) {
121121
fmt.Println("\x1b[1m━━━", path, strings.Repeat("━", 65-len(path)), "\x1b[0m")
122122
fmt.Print(pErr.Error())
123123
fmt.Println()
124-
fmt.Println("─── ErrorWithLocation()", strings.Repeat("–", 47))
124+
fmt.Println("─── ErrorWithPosition()", strings.Repeat("–", 47))
125125
fmt.Print(pErr.ErrorWithPosition())
126126
fmt.Println("─── ErrorWithUsage()", strings.Repeat("–", 50))
127127
fmt.Print(pErr.ErrorWithUsage())

internal/toml-test/json.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build go1.16
2+
// +build go1.16
3+
14
package tomltest
25

36
import (

internal/toml-test/runner.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//go:generate ./gen-multi.py
22

3+
//go:build go1.16
4+
// +build go1.16
5+
36
package tomltest
47

58
import (

internal/toml-test/toml.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build go1.16
2+
// +build go1.16
3+
14
package tomltest
25

36
import (

0 commit comments

Comments
 (0)