-
Notifications
You must be signed in to change notification settings - Fork 18k
os: documentation of Rename
doesn't specify the behavior of trying to rename a file to an existing directory
#68690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
other language supports file move in build-in library
Other language does not support file move, but have more clear comments
and here is go's comment
|
The mv command and |
yes, but the comment of
|
Thanks, I sent https://go.dev/cl/602178. |
Change https://go.dev/cl/602178 mentions this issue: |
Rename
doesn't specify the behavior of trying to rename a file to an existing directory
Go version
go version go1.22.2 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
code in https://go.dev/play/p/GmHflbjn1uG
same as below
What did you see happen?
// test file move
// file: a.conf, dir: a.bak, move
a.conf
toa.bak
program output:
What did you expect to see?
move file to dir without error, and
what did you want
add a dedicate
os.Move()
command just likemv
(i know mv is utility of rename), or add comment toos.Rename
suggest developer useos.Rename(file.conf, file.bak/file.conf)
is this circumstanceThe text was updated successfully, but these errors were encountered: