-1

I am working on some Golang source code, and confusing on Program syntax as below. What does mean about the json:"make" at the end of Make string in Golang?

type Vehicle struct {
    Make            string `json:"make"`
    Model           string `json:"model"`
    Reg             string `json:"reg"`
    VIN             int    `json:"VIN"`                 
    Owner           string `json:"owner"`
    Scrapped        bool   `json:"scrapped"`
    Status          int    `json:"status"`
    Colour          string `json:"colour"`
    V5cID           string `json:"v5cID"`
    LeaseContractID string `json:"leaseContractID"`
}
Will_Z
  • 258
  • 3
  • 15

1 Answers1

1

Tags are used by encoding packages like encoding/json or encoding/xml to control how fields are interpreted during encoding and decoding. Uses of tags are already discussed in this thread: What are the use(s) for tags in Go?

Community
  • 1
  • 1
Reekdeb Mal
  • 728
  • 1
  • 7
  • 13