Not planned
Description
What version of Go are you using (go version
)?
go version go1.19.3 darwin/amd64
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (go env
)?
go env
Output
GO111MODULE="" GOARCH="amd64" GOBIN="/Users/houruizhe/go/bin" GOCACHE="/Users/houruizhe/Library/Caches/go-build" GOENV="/Users/houruizhe/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/houruizhe/go/pkg/mod" GONOPROXY="*.byted.org,*.everphoto.cn,git.smartisan.com" GONOSUMDB="*.byted.org,*.everphoto.cn,git.smartisan.com" GOOS="darwin" GOPATH="/Users/houruizhe/go" GOPRIVATE="*.byted.org,*.everphoto.cn,git.smartisan.com" GOPROXY="https://go-mod-proxy.byted.org|https://goproxy.cn|https://proxy.golang.org|direct" GOROOT="/usr/local/Cellar/go/1.19.3/libexec" GOSUMDB="sum.golang.google.cn" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.19.3/libexec/pkg/tool/darwin_amd64" GOVCS="" GOVERSION="go1.19.3" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" GOWORK="" 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/t3/3ck0t1213rnc8sdjm5sv6hn00000gp/T/go-build2127940362=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
What did you expect to see?
The last sort does not change the sequence.
What did you see instead?
It reverse the slice.
Activity
seankhliao commentedon Dec 6, 2022
working as intended. the less function needs to conform to the documented properties for it to work correctly.
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
For questions please refer to https://github.com/golang/go/wiki/Questions
hrz123 commentedon Dec 6, 2022
Get. I read the document and see this. I guess when both Less(i, j) and Less(j, i) are true, the elements at index i and j are not considered equal.
