You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmm... That explains it. I still would argue that a for range loop with only one variable of interest should be the object itself and not the index of the list.
mikioh
changed the title
For each loop over slice of int64 gets automatically converted to int
spec: For each loop over slice of int64 gets automatically converted to int
Jul 21, 2017
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.8.3
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN="/home/logrhythm/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/logrhythm/go"
GORACE=""
GOROOT="/bin/go"
GOTOOLDIR="/bin/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build020353338=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you do?
for each automatically converts the type:
https://play.golang.com/p/VMm13-ykYS
What did you expect to see?
Type preserved. The Go compiler should not assume int64 is unnecessary.
What did you see instead?
Types were converted from int64 to int
The text was updated successfully, but these errors were encountered: