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.

11m read timeFrom ardanlabs.com
Post cover image
Table of contents
Introductionjson.Marshal vs json.EncoderSimple MarshalingField TagsCustom SerializationStreaming JSONConclusion

Sort: