From 39ed6b14b4212008e32bb53e87fd46d4faa13ce2 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 6 Jul 2017 20:02:26 +0000 Subject: cmd/doc: print Go syntax when printing struct.field docs Fixes #20928 Change-Id: I7f7aafb8ff4b5deb50c286a9ae81c34ee85e56a9 Reviewed-on: https://go-review.googlesource.com/47730 Reviewed-by: Rob Pike Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/cmd/doc/testdata/pkg.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/cmd/doc/testdata') diff --git a/src/cmd/doc/testdata/pkg.go b/src/cmd/doc/testdata/pkg.go index 4e08c84233..99755b11c5 100644 --- a/src/cmd/doc/testdata/pkg.go +++ b/src/cmd/doc/testdata/pkg.go @@ -80,6 +80,10 @@ func (ExportedType) unexportedMethod(a int) bool { return true } +type ExportedStructOneField struct { + OnlyField int // the only field +} + // Constants tied to ExportedType. (The type is a struct so this isn't valid Go, // but it parses and that's all we need.) const ( -- cgit v1.3-5-g9baa