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:
parent
5b623d7046
commit
c9d84a0ca2
1 changed files with 2 additions and 6 deletions
8
uri.go
8
uri.go
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue