Created
January 27, 2023 09:56
-
-
Save arriqaaq/8bcb483b928d5ad6ac55854c33de9b72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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