Skip to content

Commit

Permalink
cmd/go/testdata: don't set GOPATH=NUL in test
Browse files Browse the repository at this point in the history
An upcoming change to the filepath package to make IsAbs("NUL")==false
on Windows will cause this test to fail, since it sets GOPATH=NUL and
GOPATH must be an absolute path.

Set GOPATH to the name of a text file instead. (The intent is that GOPATH
be set to a path that is not writable.)

For #56217.

Change-Id: I18e645fe11547d02d1a2e0e580085e6348c4009a
Reviewed-on: https://go-review.googlesource.com/c/go/+/448896
Reviewed-by: Bryan Mills <[email protected]>
Run-TryBot: Damien Neil <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
neild committed Nov 9, 2022
1 parent 4f13067 commit 342751a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cmd/go/testdata/script/mod_init_empty.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
env GO111MODULE=on

env GOPATH=$devnull
env GOPATH=$WORK${/}invalid-gopath

go list -m
stdout '^example.com$'
Expand All @@ -16,3 +16,6 @@ go 1.13
package main

func main() {}

-- $WORK/invalid-gopath
This is a text file, not a directory.

0 comments on commit 342751a

Please sign in to comment.