Skip to content
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

path: Join documentation is misleading regarding Cleaned #29875

Open
rillig opened this issue Jan 22, 2019 · 3 comments

Comments

Projects
None yet
5 participants
@rillig
Copy link
Contributor

commented Jan 22, 2019

As of Go 1.11.4, the documentation of path.Join says:

Join joins any number of path elements into a single path, adding a separating slash if necessary. The result is Cleaned; in particular, all empty strings are ignored.

Since Cleaned is written in uppercase, this suggests that path.Clean is called on the preliminary result of Join. For most cases this is true, but for the case of only empty filenames, it isn't. There, path.Join("") returns an empty string while path.Clean("") returns dot.

See https://play.golang.org/p/rjq7up_HplU.

@robpike

This comment has been minimized.

Copy link
Contributor

commented Jan 22, 2019

A bug in the code, but maybe too hard to fix. Might need a documentation fix instead.

@FiloSottile FiloSottile added this to the Go1.13 milestone Jan 23, 2019

@Avni-Sharma

This comment has been minimized.

Copy link

commented Mar 5, 2019

Has this been updated yet?

@rillig

This comment has been minimized.

Copy link
Contributor Author

commented Mar 5, 2019

Has this been updated yet?

No, otherwise the Gerrit change request would be linked with this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.