You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the source, os.Rename will always return a LinkError if it returns an error, however the documentation does NOT state that behaviour.
If it's intended to be a reliable feature of this function, it should be in the docstring, in the same way that os.Create and os.Stat return PathError. Otherwise, I feel that I need to manually ensure that the information provided by LinkError is logged separately, in case future implementations of the os.Rename function don't return the details of the renamed files in the error message.
The text was updated successfully, but these errors were encountered:
adg
changed the title
os.Rename should document that it returns LinkError, if that is the intended specification.
os: Rename should document that it returns LinkError, if that is the intended specification.
Mar 3, 2015
Updates #10061
CL 12353 updated the documentation for os.Rename to stipulate the function will
return errors of type *os.LinkError. This CL adds a test to ensure that the
implementations continue to obey this contract.
Change-Id: I41beb8c9d8356c737de251fdc6f652caab3ee636
Reviewed-on: https://go-review.googlesource.com/12329
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Looking at the source, os.Rename will always return a LinkError if it returns an error, however the documentation does NOT state that behaviour.
If it's intended to be a reliable feature of this function, it should be in the docstring, in the same way that os.Create and os.Stat return PathError. Otherwise, I feel that I need to manually ensure that the information provided by LinkError is logged separately, in case future implementations of the os.Rename function don't return the details of the renamed files in the error message.
The text was updated successfully, but these errors were encountered: