Chapter 9. Generated JSON Functions

Table of Contents

Custom JSON Attributes
Custom JSON Marshal/Unmarshal Functions
Invoking JSON Marshal/Unmarshal Functions

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:

The following sections describe what is done in each of these areas and also general procedures for encoding and decoding JSON data.