I'm totally newbie in Golang and solving problem with parsing JSON. Everything is working, except error handling.
if err := json.Unmarshal(file, &configData); err != nil {
if ute, ok := err.(*json.UnmarshalTypeError); ok {
fmt.Printf("UnmarshalTypeError %v - %v - %v", ute.Value, ute.Type, ute.Offset)
}
}
Here I get error ute.Offset undefined (type *json.UnmarshalTypeError has no field or method Offset)
but in Docs of JSON package and also code they have this variable in UnmarshalTypeError
struct.
What I'm doing wrong? Thank you