]> Cypherpunks repositories - gostls13.git/commitdiff
io/ioutil: use pathname instead of name in docs to avoid confusion
authorShenghou Ma <minux.ma@gmail.com>
Sat, 13 Oct 2012 11:05:22 +0000 (19:05 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Sat, 13 Oct 2012 11:05:22 +0000 (19:05 +0800)
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

src/pkg/io/ioutil/tempfile.go

index 257e05d2152da8d54a00705d778034092779a3fc..4a06e9756fb3f909e1ce84db6084a608694d2839 100644 (file)
@@ -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()