Skip to content

Instantly share code, notes, and snippets.

@miguelmota
miguelmota / json_marshal_unmarshal.go
Last active November 24, 2022 09:00
Golang JSON Marshal (struct to string) (M for "Make json") and Unmarshal (string to struct) (U for "Unmake json") example
package main
import (
"encoding/json"
"fmt"
)
func main() {
type MyStruct struct {
Message string `json:"message"`