]> Cypherpunks repositories - gostls13.git/commitdiff
os: document that Rename overwrites existing file
authorRuss Cox <rsc@golang.org>
Wed, 6 Jan 2016 19:43:16 +0000 (14:43 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 7 Jan 2016 00:41:10 +0000 (00:41 +0000)
Fixes #13673.

Change-Id: I60d1603ca0dfd2ae136117e0f89cee4b6fc6c3d3
Reviewed-on: https://go-review.googlesource.com/18332
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/os/file.go

index 6acc57a918cd4c4723685d0720c11329fd476279..4f8e3f3450c0e5859416eff2b258abfb29716c38 100644 (file)
@@ -256,7 +256,9 @@ func Create(name string) (*File, error) {
 // lstat is overridden in tests.
 var lstat = Lstat
 
-// Rename renames (moves) a file. OS-specific restrictions might apply.
+// Rename renames (moves) oldpath to newpath.
+// If newpath already exists, Rename replaces it.
+// OS-specific restrictions may apply when oldpath and newpath are in different directories.
 // If there is an error, it will be of type *LinkError.
 func Rename(oldpath, newpath string) error {
        return rename(oldpath, newpath)