From 997278a2441e4e3334cce886ddb564fb430a8914 Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Sun, 7 Jun 2020 20:35:18 +0900 Subject: [PATCH] Fix test case by new result of PrintErrorTOken --- decode_test.go | 9 ++++----- validate_test.go | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/decode_test.go b/decode_test.go index 50d633f7..166f56c7 100644 --- a/decode_test.go +++ b/decode_test.go @@ -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) @@ -1587,7 +1586,7 @@ complecated: string // 1 | --- // 2 | simple: string // > 3 | complecated: string - // ^ + // ^ } type unmarshalableStringValue string diff --git a/validate_test.go b/validate_test.go index b36deea0..b21e4d3d 100644 --- a/validate_test.go +++ b/validate_test.go @@ -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 }