Skip to content

Instantly share code, notes, and snippets.

@vaguecoder
Last active December 16, 2021 17:50
Show Gist options
  • Save vaguecoder/e8b1291deb4b689cce5304a79230d09e to your computer and use it in GitHub Desktop.
Save vaguecoder/e8b1291deb4b689cce5304a79230d09e to your computer and use it in GitHub Desktop.
var jsonData []byte
jsonData, err = json.Marshal(data)
if err != nil {
// Handle Error
}
fmt.Println(jsonData) // JSON data in bytes
fmt.Println(string(jsonData)) // String for format verification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment