path/filepath: rename func VolumeName(path string) string #40158
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?Operating system and architecture independent.
What did you do?
Read the docs.
What did you expect to see?
or something similar that reflects what
VolumeName
actually returns.-or-
Documentation to the effect that
VolumeName
in fact returns a volume name.A volume name on Windows is also known as a volume label.
What did you see instead?
The function certainly does not return a volume name, hence either the name or its behavior and documentation are wrong.
Having
VolumeName("C:\A")
return "C:" is confusing and inconsistent. It could also be considered wrong, since "C:" is a relative path which would resolve to%CD%
orC:.
andAbs
is also documented to never returnC:
for probably this reason. However this issue is about the function returning a path, not a name, as one would not be overly unjustified expect.The text was updated successfully, but these errors were encountered: