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
+32.5k Golang : Copy directory - including sub-directories and files
+5.8k Golang : Fix opencv.LoadHaarClassifierCascade The node does not represent a user object error
+8.8k Golang : Heap sort example
+18.7k Golang : convert int to string
+8.1k Golang : Get all countries phone codes
+11.6k Golang : Surveillance with web camera and OpenCV
+30.9k Golang : Interpolating or substituting variables in string examples
+18.1k Golang : Convert IPv4 address to decimal number(base 10) or integer
+28.6k Golang : Read, Write(Create) and Delete Cookie example
+6.3k Javascript : Generate random key with specific length