Source file src/cmd/go/internal/base/env.go

     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.
    11  func AppendPWD(base []string, dir string) []string {
    12  	// Internally we only use absolute paths, so dir is absolute.
    13  	// Even if dir is not absolute, no harm done.
    14  	return append(base, "PWD="+dir)
    15  }
    16  

View as plain text