Commit 5d8442ae authored by Russ Cox's avatar Russ Cox

os: document that Rename overwrites existing file

Fixes #13673.

Change-Id: I60d1603ca0dfd2ae136117e0f89cee4b6fc6c3d3
Reviewed-on: https://go-review.googlesource.com/18332Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent dba926d7
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment