Skip to content

cmd/go: 'go generate' fails to update PWD variable #43862

@bcmills

Description

@bcmills

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.

As noted in #43724 (comment) (CC @dylan-bourque), go generate currently fails to do so when invoking the generator command:

cmd.Env = str.StringList(cfg.OrigEnv, g.env)

It should be updated to do so.

(CC @matloob @jayconrod)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions