Skip to content

Commit

Permalink
doc: enforce gotypesalias=0 behavior until go1.23
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
adonovan authored and gopherbot committed Apr 15, 2024
1 parent dd0410f commit 0c3722a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gopls/doc/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.16
// +build go1.16

// Command generate creates API (settings, etc) documentation in JSON and
// Markdown for machine and human consumption.
package main
Expand Down Expand Up @@ -48,6 +45,10 @@ func main() {
}

func doMain(write bool) (bool, error) {
// TODO(adonovan): when we can rely on go1.23,
// switch to gotypesalias=1 behavior.
os.Setenv("GODEBUG", "gotypesalias=0")

api, err := loadAPI()
if err != nil {
return false, err
Expand Down Expand Up @@ -451,6 +452,7 @@ func typeDoc(arg *commandmeta.Field, level int) string {
case *types.Slice:
return fmt.Sprintf("[]%s", u.Elem().Underlying().String())
}
// TODO(adonovan): use (*types.Package).Name qualifier.
return types.TypeString(under, nil)
}

Expand Down

0 comments on commit 0c3722a

Please sign in to comment.