1
0
Fork 0
mirror of https://github.com/laravel-ls/uri synced 2026-06-16 01:54:57 +02:00

in File() join if statements

This commit is contained in:
Henrik Hautakoski 2025-06-20 10:20:32 +02:00
parent 5b623d7046
commit c9d84a0ca2

8
uri.go
View file

@ -101,14 +101,10 @@ func File(path string) URI {
} }
} }
if !isWindowsDrivePath(path) {
if abs, err := filepath.Abs(path); err == nil {
path = abs
}
}
if isWindowsDrivePath(path) { if isWindowsDrivePath(path) {
path = "/" + path path = "/" + path
} else if absPath, err := filepath.Abs(path); err == nil {
path = absPath
} }
path = filepath.ToSlash(path) path = filepath.ToSlash(path)