Non-JSON Wire Formats
Encoding that is not JSON: encoding/xml attributes and character data, encoding/csv quoting, encoding/binary byte order, gob, base64 and hex. Each has a trap that quietly corrupts data.
part ofGo (Golang)overview, primer and where to startread it →on this pageshowhide
explore
- XML Structs and Tags4 questions
- XML Token Streaming5 questions
- CSV Reading and Quoting5 questions
- Compressed Streams5 questions
- Byte Order with encoding/binary4 questions
- Self-Describing gob Streams5 questions
- Base64 and Hex Codecs4 questions
questions
page 2 of 2A Go import sets csv.Reader.ReuseRecord = true and keeps every record; why do all rows end up identical?
level: seniorimportance: nice to knowfreq 28%
basics
~20 sWith ReuseRecord set, Read may return a slice sharing the previous call's backing array, so every retained row points at that one array and shows whatever the last record left in it. Copy each record you intend to keep.
Two Go services share a gob cache file; which struct changes on one side break the other's decode?
level: seniorimportance: nice to knowfreq 24%
basics
~20 sAdding or removing an exported field is tolerated: gob matches fields by name, discards unknown ones and leaves missing ones untouched. Renames silently lose data, incompatible type changes fail at decode, and relocating a registered type breaks interface-typed fields.
showing 31–32 of 32