We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
$ go version go version devel go1.18-5337e53dfa Sun Nov 14 17:38:42 2021 +0000 linux/amd64
Yes.
go env
$ go env GO111MODULE="on" GOARCH="amd64" GOBIN="" GOCACHE="/home/ainar/.cache/go-build" GOENV="/home/ainar/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/ainar/go/pkg/mod" GONOPROXY="REMOVED" GONOSUMDB="REMOVED" GOOS="linux" GOPATH="/home/ainar/go" GOPRIVATE="REMOVED" GOPROXY="https://proxy.golang.org,direct" GOROOT="/home/ainar/go/tip" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/ainar/go/tip/pkg/tool/linux_amd64" GOVCS="" GOVERSION="devel go1.18-5337e53dfa Sun Nov 14 17:38:42 2021 +0000" 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 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3251505622=/tmp/go-build -gno-record-gcc-switches"
package main import ( "fmt" "golang.org/x/exp/slices" ) func main() { fmt.Printf("%#v\n", slices.Clone([]int(nil))) fmt.Printf("%#v\n", slices.Clone([]int{})) fmt.Printf("%#v\n", slices.Clone([]int{1})) }
[]int(nil) []int{} []int{1}
[]int(nil) []int(nil) []int{1}
The text was updated successfully, but these errors were encountered:
Change https://golang.org/cl/365174 mentions this issue: slices: preserve nil/non-nil in Clone
slices: preserve nil/non-nil in Clone
Sorry, something went wrong.
golang/exp@eb295bb
I confirm that the fix works, thanks!
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: