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
Even if it was a valid utf-8 string, one should not expect the indices to be serial. A range loop iterates over unicode code points rather than bytes. To iterate on bytes, use the regular for loop.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version:1.9.5
go version:1.10.2
Does this issue reproduce with the latest release?
yes ,it reproduce in 1.10.2 version
What operating system and processor architecture are you using (
go env
)?I have to two go version for use
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/tbwisk/go"
GORACE=""
GOROOT="/usr/local/Cellar/[email protected]/1.9.5/libexec"
GOTOOLDIR="/usr/local/Cellar/[email protected]/1.9.5/libexec/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/4b/mfftzbmx3t58tvq3t0_zq3100000gp/T/go-build136633725=/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"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/tbwisk/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/tbwisk/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.2/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
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"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/4b/mfftzbmx3t58tvq3t0_zq3100000gp/T/go-build563777223=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
https://play.golang.org/p/NKAi82Azthk
my go code
What did you expect to see?
0
1
2
3
What did you see instead?
0
2
3
The text was updated successfully, but these errors were encountered: