Skip to content

Commit

Permalink
cmd/go: update PWD variable for 'go generate'
Browse files Browse the repository at this point in the history
Most subprocess invocations in the go command use base.AppendPWD to
append an accurate value of PWD to the command's environment, which can
speed up calls like os.Getwd and also help to provide less-confusing
output from scripts. Update `go generate` to do so.

Fixes #43862

Change-Id: I3b756f1532b2d922f7d74fd86414d5567a0122c0
  • Loading branch information
qingyunha committed Mar 5, 2021
1 parent 01293bf commit 3ec8da2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/go/testdata/script/generate.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ stdout 'main_test'

# Test go generate provides the right "$PWD"
go generate './generate/env_pwd.go'
stdout $WORK'/gopath/src/generate'
stdout $WORK'[/\\]gopath[/\\]src[/\\]generate'

-- echo.go --
package main
Expand Down

0 comments on commit 3ec8da2

Please sign in to comment.