GoLand
 
Get GoLand

Working with JSON

Last modified: 11 October 2024

JavaScript Object Notation (JSON) is a textual format in which you can represent, store, and transfer structural data.

In Go, map and struct data types provide the closest JSON representation as they can store data in a key:value format.

When you paste JSON in GoLand, the IDE suggests converting it to the struct type. All the necessary struct field tags are generated and added automatically.

You can use the copy-and-paste approach or the Generate Go Type from JSON dialog.