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.IsAbs()
wrong in Windows
#42995
Labels
Comments
Please use |
ohoh. Is there any difference between these two? I checked the documents of these two packages, and his instructions are the same
|
And it doesn’t seem to not handle windows style // IsAbs reports whether the path is absolute.
func IsAbs(path string) bool {
return strings.HasPrefix(path, "/")
} // IsAbs reports whether the path is absolute.
func IsAbs(path string) bool {
return len(path) > 0 && path[0] == '/'
} |
Please check path_windows.go
If this is not a question, please close this. Thank you. |
ok. my bad. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Determine whether a windows path is an absolute path
What did you expect to see?
path.IsAbs("D:\\a\\whatchanged\\whatchanged")
// should be trueWhat did you see instead?
path.IsAbs("D:\\a\\whatchanged\\whatchanged")
// but got falsehere is the CI:
https://github.com/axetroy/whatchanged/runs/1497192324
here is the source code:
https://github.com/axetroy/whatchanged/blob/5050ea45deb73d861df1b2e62f945502a2c78c7d/internal/client/git.go#L41-L43
The text was updated successfully, but these errors were encountered: