-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.FrozenDueToAgeProposal
Milestone
Description
What did you do?
I was trying to write some unit tests that my code returned the right *time.Location, but all my attempts to compare the results failed.
https://play.golang.org/p/xQpqTvYQezo
What did you expect to see?
Requesting the same location should have produced two values that would be equal.
x==y seems to just use the pointers, so it's not a deep equal.
Given the private fields in Location, there should be a method on Location that compares the name and the offset to see if they are really equal.
What did you see instead?
Values were not equivalent.
Does this issue reproduce with the latest release (go1.12.4)?
yes
System details
go version go1.12 linux/amd64
GOARCH="amd64"
GOBIN="/usr/lib/google-golang/bin"
GOCACHE="/usr/local/google/home/roberts/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/usr/lib/google-golang/bin/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/google-golang"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/google-golang/pkg/tool/linux_amd64"
GCCGO="/usr/bin/gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
GOROOT/bin/go version: go version go1.12 linux/amd64
GOROOT/bin/go tool compile -V: compile version go1.12
uname -sr: Linux 4.18.10-1rodete2-amd64
Distributor ID: Debian
Description: Debian GNU/Linux rodete (upgraded from: Ubuntu 14.04.5 LTS)
Release: rodete
Codename: rodete
/lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Debian GLIBC 2.24-12) stable release version 2.24, by Roland McGrath et al.
gdb --version: GNU gdb (GDB) 8.2-gg10
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.FrozenDueToAgeProposal