summaryrefslogtreecommitdiffstats
path: root/lib/common/filepath.go
blob: 603c2a2685d8d9a92cdd656a0a5d690b878c3f7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package common

import "os"

// Exists returns whether the given file or directory exists or not
func Exists(path string) bool {
	_, err := os.Stat(path)
	if err == nil {
		return true
	}
	if os.IsNotExist(err) {
		return false
	}
	return true
}