Skip to content

Commit 0c3722a

Browse files
adonovangopherbot
authored andcommitted
doc: enforce gotypesalias=0 behavior until go1.23
Later, we can switch to using aliases, which produces nicer output. Updates golang/go#65294 Change-Id: I1d807651cccf52961779cf66e057f859f2bb3a05 Reviewed-on: https://go-review.googlesource.com/c/tools/+/578324 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Robert Findley <[email protected]> Auto-Submit: Alan Donovan <[email protected]>
1 parent dd0410f commit 0c3722a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gopls/doc/generate.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build go1.16
6-
// +build go1.16
7-
85
// Command generate creates API (settings, etc) documentation in JSON and
96
// Markdown for machine and human consumption.
107
package main
@@ -48,6 +45,10 @@ func main() {
4845
}
4946

5047
func doMain(write bool) (bool, error) {
48+
// TODO(adonovan): when we can rely on go1.23,
49+
// switch to gotypesalias=1 behavior.
50+
os.Setenv("GODEBUG", "gotypesalias=0")
51+
5152
api, err := loadAPI()
5253
if err != nil {
5354
return false, err
@@ -451,6 +452,7 @@ func typeDoc(arg *commandmeta.Field, level int) string {
451452
case *types.Slice:
452453
return fmt.Sprintf("[]%s", u.Elem().Underlying().String())
453454
}
455+
// TODO(adonovan): use (*types.Package).Name qualifier.
454456
return types.TypeString(under, nil)
455457
}
456458

0 commit comments

Comments
 (0)