os: clarify behavior of TempDir

Fixes #19695

Change-Id: Ie5103f7905969e25dba6e5fb37344b70e807fc69
Reviewed-on: https://go-review.googlesource.com/45702
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Brad Fitzpatrick 2017-06-14 18:29:49 +00:00
parent 071908f3d8
commit 0b81c023a7
4 changed files with 16 additions and 6 deletions

View file

@ -294,8 +294,7 @@ func Remove(name string) error {
return &PathError{"remove", name, e}
}
// TempDir returns the default directory to use for temporary files.
func TempDir() string {
func tempDir() string {
dir := Getenv("TMPDIR")
if dir == "" {
if runtime.GOOS == "android" {