Understanding the difference between json.Marshal and json.NewEncoder in Go, this post explores simple marshaling, using struct tags for custom JSON properties, and how to implement json.Marshaler for custom types. It also covers streaming JSON with JSON lines and chunked transfer encoding over HTTP.
Table of contents
Introductionjson.Marshal vs json.EncoderSimple MarshalingField TagsCustom SerializationStreaming JSONConclusionSort: