Skip to content

Commit

Permalink
Fix test case by new result of PrintErrorTOken
Browse files Browse the repository at this point in the history
  • Loading branch information
goccy committed Jun 7, 2020
1 parent c36db77 commit 997278a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 4 additions & 5 deletions decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1487,10 +1487,9 @@ a: c
`
expected := `
[3:1] duplicate key "a"
2 |
> 3 | a: b
4 | a: c
^
2 | a: b
> 3 | a: c
^
`
var v map[string]string
err := yaml.NewDecoder(strings.NewReader(yml), yaml.DisallowDuplicateKey()).Decode(&v)
Expand Down Expand Up @@ -1587,7 +1586,7 @@ complecated: string
// 1 | ---
// 2 | simple: string
// > 3 | complecated: string
// ^
// ^
}

type unmarshalableStringValue string
Expand Down
3 changes: 1 addition & 2 deletions validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ func ExampleStructValidator() {
fmt.Printf("%v", err)
// OUTPUT:
// [5:8] Key: 'Person.Age' Error:Field validation for 'Age' failed on the 'gte' tag
// 1 | ---
// 2 | - name: john
// 3 | age: 20
// 4 | - name: tom
// > 5 | age: -1
// ^
// ^
// 6 | - name: ken
// 7 | age: 10
}

0 comments on commit 997278a

Please sign in to comment.