os: TempDir(): obey TMPDIR on unix, TMP on win, etc

Uses upstream go code, lightly adjusted.

Adds smoke test.
This commit is contained in:
Dan Kegel
2021-11-21 17:28:40 -08:00
committed by Ron Evans
parent e354a3523b
commit 6b0f2cd697
5 changed files with 81 additions and 3 deletions
+4
View File
@@ -56,3 +56,7 @@ func putchar(c byte)
func Pipe() (r *File, w *File, err error) {
return nil, nil, ErrNotImplemented
}
func tempDir() string {
return "/tmp"
}