Golang encoding/json.UnsupportedTypeError type and function example
package encoding/json
An UnsupportedTypeError is returned by Marshal when attempting to encode an unsupported value type.
Golang encoding/json.UnsupportedTypeError type and function usage example
switch err.(type) {
case *json.UnsupportedTypeError:
fmt.Println("The provided JSON input is invalid")
// fmt.Println(err.Error())
default:
fmt.Println(err)
}
Reference :
Advertisement
Something interesting
Tutorials
+14.2k Elastic Search : Mapping date format and sort by date
+10.9k Golang : Sieve of Eratosthenes algorithm
+10.1k Golang : Identifying Golang HTTP client request
+9.3k Golang : How to get ECDSA curve and parameters data?
+13.9k Golang : Get current time
+18.1k Golang : Convert IPv4 address to decimal number(base 10) or integer
+8.9k Golang : Gaussian blur on image and camera video feed examples
+9.4k Golang : Apply Histogram Equalization to color images
+51.9k Golang : How to get time in milliseconds?
+6.3k WARNING: UNPROTECTED PRIVATE KEY FILE! error message
+5.6k PHP : Convert CSV to JSON with YQL example
+6.8k Golang : Calculate pivot points for a cross