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

rillig opened this Issue Jan 22, 2019 · 1 comment


None yet
4 participants
Copy link

rillig 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.



This comment has been minimized.

Copy link

robpike 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment