Golang encoding/json.MarshalerError type and function example
package encoding/json
Golang encoding/json.MarshalerError type and function usage example
if err != nil {
switch err.(type) {
case *json.MarshalerError:
fmt.Printf("invalid json unmarshal error: %s\n", err.Error())
default:
fmt.Printf("Error: %s\n", err)
}
Reference :
Advertisement
Something interesting
Tutorials
+25.4k Golang : Convert long hexadecimal with strconv.ParseUint example
+12.7k Golang : zlib compress file example
+12.3k Golang : Get month name from date example
+10.7k Golang : Underscore string example
+23.5k Golang : Read a file into an array or slice example
+5.3k Javascript : Shuffle or randomize array example
+17.4k Golang : Multi threading or run two processes or more example
+8.6k Golang : Add text to image and get OpenCV's X, Y co-ordinates example
+16.4k CodeIgniter/PHP : Create directory if does not exist example
+16.5k Golang : Get IP addresses of a domain name
+21.9k Golang : Use TLS version 1.2 and enforce server security configuration over client