We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Please answer these questions before submitting your issue. Thanks!
godoc -analysis=type -analysis=pointer -http :8000
No panic
2017/06/11 13:31:03 Constructing SSA form... 2017/06/11 13:31:07 SSA construction complete panic: interface conversion: types.Type is *types.Struct, not *types.Named goroutine 846 [running]: golang.org/x/tools/godoc/analysis.Run(0xc4201c0601, 0xc4201a6b30) /Users/yoshiki/gocode/src/golang.org/x/tools/godoc/analysis/analysis.go:478 +0x25c4 created by main.main /Users/yoshiki/gocode/src/golang.org/x/tools/cmd/godoc/main.go:314 +0xac2
No, because this panic seems to be caused by the introduction of "type alias".
I tried the following modification and it seemed working:
diff --git a/godoc/analysis/analysis.go b/godoc/analysis/analysis.go index c185e5ea..440e4a80 100644 --- a/godoc/analysis/analysis.go +++ b/godoc/analysis/analysis.go @@ -475,7 +475,9 @@ func Run(pta bool, result *Result) { for _, info := range iprog.AllPackages { for _, obj := range info.Defs { if obj, ok := obj.(*types.TypeName); ok { - a.allNamed = append(a.allNamed, obj.Type().(*types.Named)) + if !obj.IsAlias() { + a.allNamed = append(a.allNamed, obj.Type().(*types.Named)) + } } } }
Anyway, this is not a bug of Go1.8.3, but should be fixed with Go1.9.
go version devel +2c7043c273 Fri Jun 9 22:15:01 2017 +0000 darwin/amd64 GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/yoshiki/gocode:/Users/yoshiki/exercises/gpl:/Users/yoshiki/oak" GORACE="" GOROOT="/Users/yoshiki/tools/go" GOTOOLDIR="/Users/yoshiki/tools/go/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/pb/c7_4_d355ng5zfm4r_jg2gg00000gn/T/go-build389611353=/tmp/go-build -gno-record-gcc-switches -fno-common" CXX="clang++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOROOT/bin/go version: go version devel +2c7043c273 Fri Jun 9 22:15:01 2017 +0000 darwin/amd64 GOROOT/bin/go tool compile -V: compile version devel +2c7043c273 Fri Jun 9 22:15:01 2017 +0000 X:framepointer uname -v: Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 ProductName: Mac OS X ProductVersion: 10.12.5 BuildVersion: 16F73 lldb --version: lldb-370.0.42 Swift-3.1
The text was updated successfully, but these errors were encountered:
/cc @griesemer
Sorry, something went wrong.
Robert, since godoc is part of the release, could you look at this? It's reportedly a regression from 1.8 and related to type aliases.
CL https://golang.org/cl/45570 mentions this issue.
golang/tools@5d733ef
godoc: fix crash in -analysis
4d64644
Fixes golang/go#20641 Change-Id: I499b4b8da2899c4b606ce3eedd30caab57607a85 Reviewed-on: https://go-review.googlesource.com/45570 Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
No branches or pull requests
Please answer these questions before submitting your issue. Thanks!
What did you do?
godoc -analysis=type -analysis=pointer -http :8000
What did you expect to see?
No panic
What did you see instead?
Does this issue reproduce with the latest release (go1.8.3)?
No, because this panic seems to be caused by the introduction of "type alias".
I tried the following modification and it seemed working:
Anyway, this is not a bug of Go1.8.3, but should be fixed with Go1.9.
System details
The text was updated successfully, but these errors were encountered: