Table of Contents
The Go language contains built-in support for Marshaling/Unmarshaling data to and from JSON format. However, the default representation of the data is not always compliant with the JSON encoding rules (JER) as defined in ITU-T X.697.
Go provides mechanisms to customize the default marshalling behavior so that alternate JSON formats, including JER, can be supported. This is done through two code alterations:
Setting custom JSON attributes
Creating custom JSON Marshal/Unmarshal functions for specific types.
The following sections describe what is done in each of these areas and also general procedures for encoding and decoding JSON data.