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.Trim missing "\g" #54194

Closed
wjw1758548031 opened this issue Aug 2, 2022 · 2 comments
Closed

strings.Trim missing "\g" #54194

wjw1758548031 opened this issue Aug 2, 2022 · 2 comments

Comments

@wjw1758548031
Copy link
Contributor

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

$ go version
go version go1.16.5 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
GO111MODULE=""
GOARCH="amd64"
GOBIN="/Users/wangjianwen/Desktop/env/gopath/bin"
GOCACHE="/Users/wangjianwen/Library/Caches/go-build"
GOENV="/Users/wangjianwen/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/wangjianwen/Desktop/env/gopath/pkg/mod"
GONOPROXY="gitlab.hexcloud.cn"
GONOSUMDB="gitlab.hexcloud.cn"
GOOS="darwin"
GOPATH="/Users/wangjianwen/Desktop/env/gopath"
GOPRIVATE="gitlab.hexcloud.cn"
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.5"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/j2/4prbjxtx0j763nxx22f94wph0000gn/T/go-build3340131209=/tmp/go-build -gno-record-gcc-switches -fno-common"
GOROOT/bin/go version: go version go1.16.5 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.16.5
uname -v: Darwin Kernel Version 19.6.0: Thu Oct 29 22:56:45 PDT 2020; root:xnu-6153.141.2.2~1/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.15.7
BuildVersion:	19H15
lldb --version: lldb-1200.0.44.2
Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)

What did you do?

https://go.dev/play/p/VJ8lo3_nAyk?v=gotip.go

What did you expect to see?

/go_project

What did you see instead?

o_project

@slrz
Copy link

slrz commented Aug 2, 2022

This matches the documented behaviour. Did you mean to use strings.TrimPrefix instead?

@seankhliao
Copy link
Member

Working as intended

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2022
@golang golang locked and limited conversation to collaborators Aug 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants