Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/doc: describe aliases #17762

Closed
rsc opened this issue Nov 3, 2016 · 1 comment
Closed

cmd/doc: describe aliases #17762

rsc opened this issue Nov 3, 2016 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Nov 3, 2016

I added this to cmd/doc/testdata/pkg.go:

diff --git a/src/cmd/doc/testdata/pkg.go b/src/cmd/doc/testdata/pkg.go
index 924daa1..0a5ecdc 100644
--- a/src/cmd/doc/testdata/pkg.go
+++ b/src/cmd/doc/testdata/pkg.go
@@ -5,6 +5,13 @@
 // Package comment.
 package pkg
 
+import (
+	"io"
+	"math"
+	"text/template"
+	"unicode"
+)
+
 // Constants
 
 // Comment about exported constant.
@@ -172,3 +179,12 @@ const (
 )
 
 const ConstGroup4 ExportedType = ExportedType{}
+
+const MathPi => math.Pi
+
+func MathSin => math.Sin
+func TemplateNew => template.New
+
+var UnicodeVersion => unicode.Version
+
+type UnicodeRangeTable => unicode.RangeTable

But then go doc cmd/doc/testdata does not show anything about these, and in fact go doc cmd/doc/testdata.TemplateNew says "no symbol TemplateNew".

This is very important to fix before the release. It would be fine if the definition just showed the alias and synthesized a comment

// TemplateNew is an alias for text/template.New.
func TemplateNew => template.New
@rsc rsc added this to the Go1.8 milestone Nov 3, 2016
@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 4, 2016
@griesemer
Copy link
Contributor

Decision to back out current alias implementation. See #16339. Closing.

@golang golang locked and limited conversation to collaborators Nov 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants