3 ms·
One alternative to writing struct tags by hand is to write a little generator code to map the field names from, say, a reference .json, then calling `go generat
by ovao 9y ago
One alternative to writing struct tags by hand is to write a little generator code to map the field names from, say, a reference .json, then calling `go generate` as part of your build process.
I've wondered whether a wrapper library could do rule-based field name mapping automatically with Go's reflection facilities (which could be a productivity win), but I haven't really looked at it closely.