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
+4.9k JQuery : Calling a function inside Jquery(document) block
+17.2k Golang : Find file size(disk usage) with filepath.Walk
+10.2k Golang : Bcrypting password
+8.2k Golang : Reverse text lines or flip line order example
+11.8k Golang : Verify Linux user password again before executing a program example
+12k Golang : Find and draw contours with OpenCV example
+18k Golang : How to log each HTTP request to your web server?
+13.3k CodeIgniter : "Fatal error: Cannot use object of type stdClass as array" message
+5k Golang : Calculate a pip value and distance to target profit example
+8.3k Swift : Convert (cast) Character to Integer?
+36.3k Golang : How to split or chunking a file to smaller pieces?
+14.6k Golang : Send email with attachment(RFC2822) using Gmail API example