]> Cypherpunks repositories - gostls13.git/commit
os/user: skip tests that invoke Current if it returns an expected error
authorBryan C. Mills <bcmills@google.com>
Thu, 20 Apr 2023 17:56:20 +0000 (13:56 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 21 Apr 2023 15:59:43 +0000 (15:59 +0000)
commit9027e5d2b486906f1fce862be295defe44cea213
tree0433bc81b5acd442ed48f2a9d2a0d973686d0c9e
parented832ed353f6386c4f1ce061d8048e31873e0439
os/user: skip tests that invoke Current if it returns an expected error

Today Current may fail if the binary is not built with cgo
and USER and/or HOME is not set in the environment.
That should not cause the test to fail.

After this change,

GOCACHE=$(go env GOCACHE) CGO_ENABLED=0 USER= HOME= go test os/user

now passes on linux/amd64.

For #59583.

Change-Id: Id290cd1088051e930d73f0dd554177124796e8f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/487015
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/os/user/cgo_user_test.go [new file with mode: 0644]
src/os/user/user_test.go