Examples json.JSONWriter usage examples. Example 1: Writing to a JSON fileThis example shows two ways to write a JSON file.