mirror of
https://gitea.com/gitea/tea.git
synced 2024-11-29 13:56:53 +01:00
16 lines
243 B
Go
16 lines
243 B
Go
|
package xdg
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"path/filepath"
|
||
|
)
|
||
|
|
||
|
func pathExists(path string) bool {
|
||
|
fi, err := os.Lstat(path)
|
||
|
if fi != nil && fi.Mode()&os.ModeSymlink != 0 {
|
||
|
_, err = filepath.EvalSymlinks(path)
|
||
|
}
|
||
|
|
||
|
return err == nil || os.IsExist(err)
|
||
|
}
|