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

x/exp/maps: Equal (and EqualFunc) don't take nilness of maps into account #56621

Closed
ainar-g opened this issue Nov 7, 2022 · 4 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@ainar-g
Copy link
Contributor

ainar-g commented Nov 7, 2022

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

$ go version
go version go1.19.3 linux/amd64

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
GO111MODULE=""                                                                                                                            
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/go1.19"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/ainar/go/go1.19/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.3"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/home/ainar/adg/AdGuardDNS/go.mod"
GOWORK="/home/ainar/adg/AdGuardDNS/go.work"
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 -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build594353111=/tmp/go-build -gno-record-gcc-switches"

What did you do?

https://go.dev/play/p/8A3M1ch-THs

What did you expect to see?

false

This is the result with reflect.DeepEqual: https://go.dev/play/p/46xr73EeC8p.

What did you see instead?

true
@gopherbot gopherbot added this to the Unreleased milestone Nov 7, 2022
@EugeneOne1
Copy link

It seems the slices.Equal function (from x/exp/slices) behaves the same way. Here is the symmetrical example: https://go.dev/play/p/tzEpU_UIA_S.

I can file a separate issue about this one, if that is more convenient.

@seankhliao
Copy link
Member

Note the documentation documents equality as same length.

@mknyszek
Copy link
Contributor

mknyszek commented Nov 7, 2022

CC @ianlancetaylor

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 7, 2022
@ianlancetaylor
Copy link
Member

This is behaving as documented and intended. Thanks.

@ianlancetaylor ianlancetaylor closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2022
@golang golang locked and limited conversation to collaborators Nov 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants