github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/go/internal/base/env.go (about) 1 // Copyright 2017 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package base 6 7 // AppendPWD returns the result of appending PWD=dir to the environment base. 8 // 9 // The resulting environment makes os.Getwd more efficient for a subprocess 10 // running in dir, and also improves the accuracy of paths relative to dir 11 // if one or more elements of dir is a symlink. 12 func AppendPWD(base []string, dir string) []string 13 14 // AppendPATH returns the result of appending PATH=$GOROOT/bin:$PATH 15 // (or the platform equivalent) to the environment base. 16 func AppendPATH(base []string) []string