diff --git a/src/os/getwd.go b/src/os/getwd.go index 64c3c4acd7e02e77c0421d641c1a6b7f3d5374bc..732ece7b098c0f1d9ad8649b9d2cf2c44518ebc3 100644 --- a/src/os/getwd.go +++ b/src/os/getwd.go @@ -15,10 +15,14 @@ var getwdCache struct { dir string } -// Getwd returns a rooted path name corresponding to the +// Getwd returns an absolute path name corresponding to the // current directory. If the current directory can be // reached via multiple paths (due to symbolic links), // Getwd may return any one of them. +// +// On Unix platforms, if the environment variable PWD +// provides an absolute name, and it is a name of the +// current directory, it is returned. func Getwd() (dir string, err error) { if runtime.GOOS == "windows" || runtime.GOOS == "plan9" { dir, err = syscall.Getwd()