This question already has an answer here:
I am going through some Golang code and came through this block of code, I am not able to comprehend it. I can see that d1,d2,d3 are variables of type int. But what is the last string json:"start"
type obj1 struct {
d1 int `json:"start"`
d2 int `json:"end"`
d3 int `json:"retries"`
}
</div>
d1
, d2
, and d3
are not variables, they are struct fields. The string is a "struct tag".
This is all described in the Struct Types documentation in the language spec.