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
+34.6k Golang : How to stream file to client(browser) or write to http.ResponseWriter?
+7.2k Golang : Null and nil value
+3.7k Java : Random alphabets, alpha-numeric or numbers only string generator
+12.7k Golang : Pass database connection to function called from another package and HTTP Handler
+7.5k Golang : Detect sample rate, channels or latency with PortAudio
+7.4k Linux : How to fix Brother HL-1110 printing blank page problem
+8.3k Useful methods to access blocked websites
+11.2k CodeIgniter : How to check if a session exist in PHP?
+9.5k Golang : Changing a RGBA image number of channels with OpenCV
+6.1k PageSpeed : Clear or flush cache on web server
+19.4k Golang : How to count the number of repeated characters in a string?
+8.6k Golang : Convert(cast) []byte to io.Reader type