From d4b46aa1b8c2e62b1e13de15741c7330fd2e9e3a Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <iant@golang.org>
Date: Wed, 7 Dec 2016 17:13:35 -0800
Subject: [PATCH] os: document that Rename does not replace an existing
 directory

Fixes #18240.

Change-Id: Ife951e2c1320b3f1362c85642615b24fd4291189
Reviewed-on: https://go-review.googlesource.com/34135
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
---
 src/os/file.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/os/file.go b/src/os/file.go
index de245c54792..d45a00b1239 100644
--- a/src/os/file.go
+++ b/src/os/file.go
@@ -260,7 +260,7 @@ func Create(name string) (*File, error) {
 var lstat = Lstat
 
 // Rename renames (moves) oldpath to newpath.
-// If newpath already exists, Rename replaces it.
+// If newpath already exists and is not a directory, 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 {
-- 
GitLab