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
+8.6k Golang : Convert(cast) []byte to io.Reader type
+16.3k Golang : convert string or integer to big.Int type
+9.7k Golang : interface - when and where to use examples
+11.6k SSL : The certificate is not trusted because no issuer chain was provided
+21.4k Curl usage examples with Golang
+6.1k Golang : Build new URL for named or registered route with Gorilla webtoolkit example
+5.4k Golang : Intercept, inject and replay HTTP traffics from web server
+48.1k Golang : How to convert JSON string to map and slice
+7.4k Golang : Hue, Saturation and Value(HSV) with OpenCV example
+18k Golang : Get all upper case or lower case characters from string example
+5.8k Golang : Find change in a combination of coins example
+16.8k Golang : read gzipped http response