在Go语言规范中,它提到了标签的简要概述:
字段声明后面可以跟一个可选的字符串文字标记,该标记成为相应字段声明中所有字段的属性.标签通过反射界面可见,但否则将被忽略.
Run Code Online (Sandbox Code Playgroud)// A struct corresponding to the TimeStamp protocol buffer. // The tag strings define the protocol buffer field numbers. struct { microsec uint64 "field 1" serverIP6 uint64 "field 2" process string "field 3" }
这是一个非常简短的解释IMO,我想知道是否有人可以提供我这些标签的用途?