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
+12.9k Golang : Convert IPv4 address to packed 32-bit binary format
+10.5k Golang : Create matrix with Gonum Matrix package example
+7.3k Golang : How to iterate a slice without using for loop?
+14.3k Golang : Simple word wrap or line breaking example
+19.2k Golang : Check whether a network interface is up on your machine
+11.3k Golang : Byte format example
+11.4k Golang : Delay or limit HTTP requests example
+6.5k PHP : Shuffle to display different content or advertisement
+6.9k Mac/Linux/Windows : Get CPU information from command line
+18.7k Unmarshal/Load CSV record into struct in Go
+7.9k Javascript : Put image into Chrome browser's console
+17k Golang : XML to JSON example