Skip to content
New issue

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

strings: replace strings.Index with strings.IndexByte #33931

Closed
akaNightmare opened this issue Aug 29, 2019 · 4 comments
Closed

strings: replace strings.Index with strings.IndexByte #33931

akaNightmare opened this issue Aug 29, 2019 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.

Comments

@akaNightmare
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.12.7 darwin/amd64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/ivan.zubok/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/ivan.zubok/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.7/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.7/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/zw/x6_dxqvs0v15850v4qsj6gch0000gn/T/go-build301222442=/tmp/go-build -gno-record-gcc-switches -fno-common"

Replace all strings.Index("some string", "ONE_CHARACTER_HERE") with strings.IndexByte("some string", 'ONE_CHARACTER_HERE') where it's possible (same situations for strings.LastIndex)

@mvdan
Copy link
Member

mvdan commented Aug 29, 2019

You don't need to file an issue for a small refactor like this, unless there's a performance bug that you've spotted.

@akaNightmare
Copy link
Author

@mvdan got it

@gopherbot
Copy link

Change https://golang.org/cl/192338 mentions this issue: strings: replace strings.Index with strings.IndexByte

@julieqiu julieqiu changed the title Replace strings.Index() with strings.IndexByte where it's possible strings: replace strings.Index with strings.IndexByte Aug 29, 2019
@julieqiu julieqiu added the NeedsFix The path to resolution is known, but the work has not been done. label Aug 29, 2019
@mvdan
Copy link
Member

mvdan commented Aug 29, 2019

The patch was rejected, and this issue doesn't seem to have anything else to act on.

@mvdan mvdan closed this as completed Aug 29, 2019
@golang golang locked and limited conversation to collaborators Aug 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants