Golang encoding/json.UnsupportedValueError type and function example
package encoding/json
Golang encoding/json.UnsupportedValueError type and function usage example
switch err.(type) {
case *json.UnsupportedValueError:
fmt.Println("The provided JSON input is invalid")
fmt.Println("I am unable to utilize value", err.Value, err.Str) // here
default:
fmt.Println(err)
}
Reference :
Advertisement
Something interesting
Tutorials
+30.4k Golang : How to verify uploaded file is image or allowed file types
+9.4k Golang : Timeout example
+12.8k Golang : http.Get example
+5.4k Python : Delay with time.sleep() function example
+7.1k Restart Apache or Nginx web server without password prompt
+5.3k Golang : How to deal with configuration data?
+6.1k Golang : Dealing with backquote
+8.1k Golang : Randomize letters from a string example
+6.9k Android Studio : Hello World example
+10.9k Golang : Sieve of Eratosthenes algorithm
+12.6k Golang : Transform comma separated string to slice example
+8.6k Golang : Add text to image and get OpenCV's X, Y co-ordinates example