-
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Related to #19. I saw this comment. So I used filepath.ToSlash but it still doesn't work in this case.
Repro
Run the following code on Windows:
import (
"fmt"
"path/filepath"
"github.com/goreleaser/fileglob"
)
func main() {
x, err := fileglob.Glob(filepath.ToSlash(`C:\Windows`))
if err != nil {
panic(err)
}
fmt.Println(x)
}Expected behavior
Since C:\Windows exists, it should print a slice with one element.
Actual behavior
It panicked with the following error:
stat static prefix ./C:/Windows: stat C:/Windows: invalid argument
filepath.ToSlash(`C:\Windows`) returns "C:/Windows". The function didn't seem to consider the C: drive letter and misunderstood that the path was relative.
Metadata
Metadata
Assignees
Labels
No labels