Check out example codes for "go change json key struct". It will help you in understanding the concepts better.

Code Example 1

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))
}

Learn ReactJs, React Native from akashmittal.com