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

Add descriptions for path.Clean and filepath.Clean #39236

Closed
HowJMay opened this issue May 24, 2020 · 1 comment
Closed

Add descriptions for path.Clean and filepath.Clean #39236

HowJMay opened this issue May 24, 2020 · 1 comment

Comments

@HowJMay
Copy link
Contributor

@HowJMay HowJMay commented May 24, 2020

What version of Go are you using (go version)?

$ go version

go version go1.14 Linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

Linux on x86

What did you do?

What did you expect to see?

The description of the documents for path.Clean and filepath.Clean not mention the difference between them. The implementation and the test cases are almost the same (the test cases are exactly the same). Do we need to append some description about the difference between the usage of these two functions to the current documents?

What did you see instead?

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented May 24, 2020

The difference between path.Clean and filepath.Clean is that the former works on slash-separated paths, and the latter works on paths separated using OS-specific separator characters (such as backslash on Windows). This is documented in the function docs if you read closely, and it is documented in the package docs of the path and filepath/path packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.