mirror of
https://github.com/golang/go
synced 2024-11-26 04:37:59 -07:00
os: correct names in CreateTemp and MkdirTemp doc comments
For #42026 Change-Id: I51e3ce9d3a4729cfac44bd3ff3f3ec80dcd5abb5 Reviewed-on: https://go-review.googlesource.com/c/go/+/285376 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
parent
ce8b318624
commit
cf263e9f77
@ -20,7 +20,7 @@ func nextRandom() string {
|
|||||||
// opens the file for reading and writing, and returns the resulting file.
|
// opens the file for reading and writing, and returns the resulting file.
|
||||||
// The filename is generated by taking pattern and adding a random string to the end.
|
// The filename is generated by taking pattern and adding a random string to the end.
|
||||||
// If pattern includes a "*", the random string replaces the last "*".
|
// If pattern includes a "*", the random string replaces the last "*".
|
||||||
// If dir is the empty string, TempFile uses the default directory for temporary files, as returned by TempDir.
|
// If dir is the empty string, CreateTemp uses the default directory for temporary files, as returned by TempDir.
|
||||||
// Multiple programs or goroutines calling CreateTemp simultaneously will not choose the same file.
|
// Multiple programs or goroutines calling CreateTemp simultaneously will not choose the same file.
|
||||||
// The caller can use the file's Name method to find the pathname of the file.
|
// The caller can use the file's Name method to find the pathname of the file.
|
||||||
// It is the caller's responsibility to remove the file when it is no longer needed.
|
// It is the caller's responsibility to remove the file when it is no longer needed.
|
||||||
@ -71,7 +71,7 @@ func prefixAndSuffix(pattern string) (prefix, suffix string, err error) {
|
|||||||
// and returns the pathname of the new directory.
|
// and returns the pathname of the new directory.
|
||||||
// The new directory's name is generated by adding a random string to the end of pattern.
|
// The new directory's name is generated by adding a random string to the end of pattern.
|
||||||
// If pattern includes a "*", the random string replaces the last "*" instead.
|
// If pattern includes a "*", the random string replaces the last "*" instead.
|
||||||
// If dir is the empty string, TempFile uses the default directory for temporary files, as returned by TempDir.
|
// If dir is the empty string, MkdirTemp uses the default directory for temporary files, as returned by TempDir.
|
||||||
// Multiple programs or goroutines calling MkdirTemp simultaneously will not choose the same directory.
|
// Multiple programs or goroutines calling MkdirTemp simultaneously will not choose the same directory.
|
||||||
// It is the caller's responsibility to remove the directory when it is no longer needed.
|
// It is the caller's responsibility to remove the directory when it is no longer needed.
|
||||||
func MkdirTemp(dir, pattern string) (string, error) {
|
func MkdirTemp(dir, pattern string) (string, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user