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
+41.2k Golang : How to count duplicate items in slice/array?
+22.2k Golang : Securing password with salt
+16.9k Golang : How to generate QR codes?
+9.3k Golang : How to get ECDSA curve and parameters data?
+18.8k Golang : Delete duplicate items from a slice/array
+4.5k Java : Generate multiplication table example
+14.3k Golang : How to shuffle elements in array or slice?
+24.1k Golang : Upload to S3 with official aws-sdk-go package
+31.7k Golang : How to convert(cast) string to IP address?
+11k Golang : Replace a parameter's value inside a configuration file example
+15.6k Golang : Validate hostname