From 3ec8da265a2777d1dcbcea00f107b8f5905f3640 Mon Sep 17 00:00:00 2001 From: Tao Qingyun Date: Wed, 27 Jan 2021 10:39:57 +0800 Subject: [PATCH] cmd/go: update PWD variable for 'go generate' 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 --- src/cmd/go/testdata/script/generate.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/go/testdata/script/generate.txt b/src/cmd/go/testdata/script/generate.txt index a2451f75ab2..73f5bbd57a9 100644 --- a/src/cmd/go/testdata/script/generate.txt +++ b/src/cmd/go/testdata/script/generate.txt @@ -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