Is there a particular reason why you don't just do this?

type Product struct {
    Weight float64
}

That should serialize to/from JSON just fine.  You can also include 
metadata about how you want it serialized:

type Product struct {
    Weight float64 `json:"weight,omitempty"`
}


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/07b5217b-2b7e-47e0-8316-fba13d869cado%40googlegroups.com.

Reply via email to