Skip to content

Instantly share code, notes, and snippets.

@YagmurOzden
YagmurOzden / json_marshal_unmarshal.go
Created November 24, 2022 09:00 — forked from miguelmota/json_marshal_unmarshal.go
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"`