Golang encoding/json.UnsupportedTypeError type and function example
package encoding/json
An UnsupportedTypeError is returned by Marshal when attempting to encode an unsupported value type.
Golang encoding/json.UnsupportedTypeError type and function usage example
switch err.(type) {
case *json.UnsupportedTypeError:
fmt.Println("The provided JSON input is invalid")
// fmt.Println(err.Error())
default:
fmt.Println(err)
}
Reference :
Advertisement
Something interesting
Tutorials
+26.3k Golang : Calculate future date with time.Add() function
+12k Golang : Clean formatting/indenting or pretty print JSON result
+15.2k Golang : Accurate and reliable decimal calculations
+12.4k Elastic Search : Return all records (higher than default 10)
+13.2k Golang : Convert(cast) int to int64
+27.7k PHP : Count number of JSON items/objects
+6.4k Golang : How to search a list of records or data structures
+7.2k Golang : Null and nil value
+14.4k Golang : How to convert a number to words
+5.8k Cash Flow : 50 days to pay your credit card debt
+13k Golang : Calculate elapsed years or months since a date
+7.5k Golang : Detect sample rate, channels or latency with PortAudio