Skip to content

strings: broken backward compatibility in 1.12 #31121

@kirillDanshin

Description

@kirillDanshin

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

$ go version
1.12

Does this issue reproduce with the latest release?

yes.

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/apple/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/apple/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12/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/cs/0p7xq1h91795xymyb6h7pbhh0000gn/T/go-build419608424=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Example 1.

go get -v github.com/fasthttp/router
cd $GOPATH/src/github.com/fasthttp/router
go test -v -run TestTreeFindCaseInsensitivePath # fails using go1.12

# switch back to 1.11.x

go test -v -run TestTreeFindCaseInsensitivePath # works

# switch back to 1.12, vendor strings.ToLower and strings.Map from 1.11.x, replace all strings.ToLower with vendored e.g. toLower()

go test -v # works

Example 2: the exactly same steps, but with github.com/gramework/gramework before hotfix
Example 3: or https://github.com/julienschmidt/httprouter
Example 4: or https://github.com/buaazp/fasthttprouter
Example ∞: or any program that relies on lowering UTF-8 characters.

What did you expect to see?

Tests pass on 1.12 without copying two functions from the standard strings package.

What did you see instead?

Broken tests and projects that can be fixed only by vendoring stdlib functions, which is at least strange keeping in mind the backward compatibility promise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions