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
+6.7k Golang : When to use make or new?
+40.1k Golang : UDP client server read write example
+7.5k Golang : How to stop user from directly running an executable file?
+4.9k Javascript : How to get width and height of a div?
+4.7k MariaDB/MySQL : Form select statement or search query with Chinese characters
+14.6k Golang : Missing Bazaar command
+7.8k Golang : Load DSA public key from file example
+9.9k Golang : Ordinal and Ordinalize a given number to the English ordinal numeral
+7.5k Golang : Dealing with struct's private part
+5.3k Golang : How to deal with configuration data?
+10.3k Golang : Wait and sync.WaitGroup example