go change json key struct code example
Example: go change json key struct
type Person struct {
Name string `json:"person_name"`
Surname string `json:"person_surname"`
}
func main(){
Bytes, err := json.Marshal(Person{"Joe", "Soap"})
if err != nil {
log.Fatal(err.Error())
}
fmt.Println(string(Bytes))
}