-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
What version of Go are you using (go version
)?
go version devel +9594ba4fe5 Fri Aug 3 15:44:22 2018 +0000 darwin/amd64
Does this issue reproduce with the latest release?
n/a, testing with tip
What operating system and processor architecture are you using (go env
)?
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/suzmue/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/suzmue/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go/"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/c4/982kvfgd4jz6_6sdlzzk2nj400fkl_/T/go-build214909991=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
$ go get -u golang.org/x/tools/go/packages/...
$ gopackages -mode=types fmt
What did you expect to see?
A Go package for fmt:
Go package "fmt":
package fmt
has incomplete exported type info
file /usr/local/go/src/fmt/doc.go
file /usr/local/go/src/fmt/format.go
file /usr/local/go/src/fmt/print.go
file /usr/local/go/src/fmt/scan.go
import "errors"
import "io"
import "math"
import "os"
import "reflect"
import "strconv"
import "sync"
import "unicode/utf8"
What did you see instead?
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x12032b2]
goroutine 56 [running]:
golang.org/x/tools/go/packages.(*loader).parseFiles.func1(0xc0000920c0, 0xc00000a400, 0xc00000a420, 0xc0000145a0, 0x1, 0xc0001e07c0, 0x3b)
/Users/suzmue/go/src/golang.org/x/tools/go/packages/packages.go:591 +0x62
created by golang.org/x/tools/go/packages.(*loader).parseFiles
/Users/suzmue/go/src/golang.org/x/tools/go/packages/packages.go:588 +0x1d8
cc @matloob