mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: treat empty and absent struct field tags as identical
Fixes #15439. Change-Id: I5a32384c46e20f8db6968e5a9e854c45ab262fe4 Reviewed-on: https://go-review.googlesource.com/22429 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
6f3f02f80d
commit
e48a2958d1
11 changed files with 48 additions and 56 deletions
|
|
@ -1700,8 +1700,8 @@ func Fldconv(f *Field, flag FmtFlag) string {
|
|||
// (The escape analysis tags do not apply to func vars.)
|
||||
// But it must not suppress struct field tags.
|
||||
// See golang.org/issue/13777 and golang.org/issue/14331.
|
||||
if flag&FmtShort == 0 && (!fmtbody || !f.Funarg) && f.Note != nil {
|
||||
str += " " + strconv.Quote(*f.Note)
|
||||
if flag&FmtShort == 0 && (!fmtbody || !f.Funarg) && f.Note != "" {
|
||||
str += " " + strconv.Quote(f.Note)
|
||||
}
|
||||
|
||||
if fmtmode == FTypeId && (sf&FmtUnsigned != 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue