From 0436a89a2c5afad41356dc1dff7c745cd30636a7 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Fri, 22 Apr 2016 16:35:29 -0700 Subject: [PATCH] spec: be more explicit about equivalence of empty string and absent field tags Note that the spec already makes that point with a comment in the very first example for struct field tags. This change is simply stating this explicitly in the actual spec prose. - gccgo and go/types already follow this rule - the current reflect package API doesn't distinguish between absent tags and empty tags (i.e., there is no discoverable difference) Fixes #15412. Change-Id: I92f9c283064137b4c8651630cee0343720717a02 Reviewed-on: https://go-review.googlesource.com/22391 Reviewed-by: Russ Cox Reviewed-by: Rob Pike --- doc/go_spec.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index e9f6476a89..13dae09420 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -1043,8 +1043,8 @@ promoted methods are included in the method set of the struct as follows:

A field declaration may be followed by an optional string literal tag, which becomes an attribute for all the fields in the corresponding -field declaration. The tags are made -visible through a reflection interface +field declaration. An empty tag string is equivalent to an absent tag. +The tags are made visible through a reflection interface and take part in type identity for structs but are otherwise ignored.

-- 2.50.0