Skip to content

Instantly share code, notes, and snippets.

@arriqaaq
Created January 27, 2023 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arriqaaq/8bcb483b928d5ad6ac55854c33de9b72 to your computer and use it in GitHub Desktop.
Save arriqaaq/8bcb483b928d5ad6ac55854c33de9b72 to your computer and use it in GitHub Desktop.
package main
import (
"encoding/json"
"fmt"
)
type Person struct {
Name string
Age int
}
func main() {
p := Person{Name: "John", Age: 30}
b, _ := json.Marshal(p)
fmt.Println(string(b))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment