在Go语言规范中,它简要介绍了标签:
字段声明后可以跟一个可选的字符串文字标签,该标签成为相应字段声明中所有字段的属性。这些标签通过反射界面可见,但在其他情况下将被忽略。
// 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的简短解释,我想知道是否有人可以提供这些标签的用途?