I was trying to analyse the GO program, when I encountered this line
"binTag := field.Tag.Get("binary")"
I was confused with value that "binTag" will be assigned.
I searched in the GO reflect Package for the syntax explanation and I found this,
func (tag StructTag) Get(key string) string
Get returns the value associated with key in the tag string. If there is no such key in the tag, Get returns the empty string. If the tag does not have the conventional format, the value returned by Get is unspecified. To determine whether a tag is explicitly set to the empty string, use Lookup.
Then I searched what is Tag mean in Golang, as an example I got this
Tag
A field declaration may be followed by an optional string literal (tag) which becomes an attribute of all the fields in the corresponding field declaration.
type T struct {
f1 string "f one"
f2 string
f3 string `f three`
f4, f5 int64 `f four and five`
}
So, now I am bit confused on exact value assigned to "binTag" after execution.
Thanks in Advance.