Golang encoding/json.InvalidUnmarshalError type and function example
package encoding/json
An InvalidUnmarshalError describes an invalid argument passed to Unmarshal. (The argument to Unmarshal must be a non-nil pointer.)
Golang encoding/json.InvalidUnmarshalError type and function usage example
if err != nil {
switch err.(type) {
case *json.InvalidUnmarshalError:
fmt.Printf("invalid json unmarshal error: %s\n", err)
default:
fmt.Printf("Error: %s\n", err)
}
Reference :
http://golang.org/pkg/encoding/json/#InvalidUnmarshalError.Error
Advertisement
Something interesting
Tutorials
+8.8k Golang : Timeout example
+10.8k Golang : Concatenate (combine) buffer data example
+5.9k CodeIgniter : form input set_value cause " to become & quot
+12.4k Golang : How to calculate the distance between two coordinates using Haversine formula
+8.8k Golang : Temperatures conversion example
+19.1k Golang : Set or Add HTTP Request Headers
+5.1k Golang : Display advertisement images or strings on random order
+21.8k Golang : How to read JPG(JPEG), GIF and PNG files ?
+5.1k Unix/Linux/MacOSx : Get local IP address
+9.4k Golang : Function wrapper that takes arguments and return result example
+30.5k Golang : How to convert(cast) string to IP address?
+27.2k Golang : Decode/unmarshal unknown JSON data type with map[string]interface