Closed
Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version
)?
go version go1.11 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env
)?
GOARCH="amd64"
GOBIN="/Users/lambda/go/bin"
GOCACHE="/Users/lambda/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/lambda/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11/libexec/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/mc/sfhb63qd0d70fmjxs0yx403r0000gn/T/go-build374526914=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
I tried getting the len() of a string. But every time i try to do that the type checker
⇣84% ➜ go build
# github.com/dexm-coin/dexmd/blockchain
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x177bcbe]
goroutine 1 [running]:
cmd/compile/internal/gc.typecheck1(0xc0003b7980, 0x1, 0xc0003b7500)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:1270 +0x3ece
cmd/compile/internal/gc.typecheck(0xc0003b7980, 0x1, 0xc0003b7500)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:238 +0x6ad
cmd/compile/internal/gc.typecheckslice(0xc00038fe00, 0x4, 0x4, 0x1)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/typecheck.go:68 +0x50
cmd/compile/internal/gc.Main(0x18c0388)
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/internal/gc/main.go:518 +0x2059
main.main()
/usr/local/Cellar/go/1.11/libexec/src/cmd/compile/main.go:51 +0x96
This is the code that is causing the panic https://github.com/BadLamb/golang-panic
Precisely this line https://github.com/BadLamb/golang-panic/blob/master/blockchain/api.go#L42
What did you expect to see?
A build
What did you see instead?
That thing