Last Updated: May 22, 2026
JSON encoding in Go is driven almost entirely by struct tags. The previous chapter showed how Marshal and Unmarshal move bytes back and forth; this one zooms in on the small string of metadata that controls every detail of the output, from field names to whether zero values appear at all. The defaults are sensible, but real APIs almost always need overrides, and the difference between a clean payload and a confusing one usually comes down to a few characters inside a backticked tag.