From: Shenghou Ma Date: Sat, 13 Oct 2012 11:05:22 +0000 (+0800) Subject: io/ioutil: use pathname instead of name in docs to avoid confusion X-Git-Tag: go1.1rc2~2134 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=240834374a3543a0e4e0071e1300cf884601ae35;p=gostls13.git io/ioutil: use pathname instead of name in docs to avoid confusion caller of ioutil.TempFile() can use f.Name() to get "pathname" of the temporary file, instead of just the "name" of the file. Also remove an out-of-date comment about random number state. R=golang-dev, r CC=golang-dev https://golang.org/cl/6649054 --- diff --git a/src/pkg/io/ioutil/tempfile.go b/src/pkg/io/ioutil/tempfile.go index 257e05d215..4a06e9756f 100644 --- a/src/pkg/io/ioutil/tempfile.go +++ b/src/pkg/io/ioutil/tempfile.go @@ -12,7 +12,7 @@ import ( "time" ) -// Random number state, accessed without lock; racy but harmless. +// Random number state. // We generate random temporary file names so that there's a good // chance the file doesn't exist yet - keeps the number of tries in // TempFile to a minimum. @@ -42,8 +42,8 @@ func nextSuffix() string { // for temporary files (see os.TempDir). // Multiple programs calling TempFile simultaneously // will not choose the same file. The caller can use f.Name() -// to find the name of the file. It is the caller's responsibility to -// remove the file when no longer needed. +// to find the pathname of the file. It is the caller's responsibility +// to remove the file when no longer needed. func TempFile(dir, prefix string) (f *os.File, err error) { if dir == "" { dir = os.TempDir()