From: Robert Griesemer Date: Mon, 30 Nov 2015 22:18:09 +0000 (-0800) Subject: spec: clarify examples for struct field tags X-Git-Tag: go1.6beta1~261 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7305b55e98a6ff747491f39e72bfd1195f1161da;p=gostls13.git spec: clarify examples for struct field tags Fixes #13420. Change-Id: Id64ebd0527881450fdaffbb66d8b1831a6b7c43c Reviewed-on: https://go-review.googlesource.com/17263 Reviewed-by: Rob Pike --- diff --git a/doc/go_spec.html b/doc/go_spec.html index 7e42bc33ee..9178ccd068 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -1051,12 +1051,18 @@ but are otherwise ignored.

-// 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"
+	x, y float64 ""  // an empty tag string is like an absent tag
+	name string  "any string is permitted as a tag"
+	_    [4]byte "ceci n'est pas un champ de structure"
+}
+
+// A struct corresponding to a TimeStamp protocol buffer.
+// The tag strings define the protocol buffer field numbers;
+// they follow the convention outlined by the reflect package.
+struct {
+	microsec  uint64 `protobuf:"1"`
+	serverIP6 uint64 `protobuf:"2"`
 }