mirror of
https://github.com/status-im/consul.git
synced 2025-01-09 05:23:04 +00:00
15 lines
220 B
Go
15 lines
220 B
Go
package lib
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
// EnsurePath is used to make sure a path exists
|
|
func EnsurePath(path string, dir bool) error {
|
|
if !dir {
|
|
path = filepath.Dir(path)
|
|
}
|
|
return os.MkdirAll(path, 0755)
|
|
}
|