mirror of
https://github.com/rclone/rclone.git
synced 2025-12-18 17:23:20 +00:00
vendor: update all dependencies to latest versions
This commit is contained in:
17
vendor/github.com/pengsrc/go-shared/check/dir.go
generated
vendored
Normal file
17
vendor/github.com/pengsrc/go-shared/check/dir.go
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
package check
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Dir checks the given path, will return error if path not exists or path
|
||||
// is not directory.
|
||||
func Dir(path string) error {
|
||||
if info, err := os.Stat(path); err != nil {
|
||||
return fmt.Errorf(`directory not exists: %s`, path)
|
||||
} else if !info.IsDir() {
|
||||
return fmt.Errorf(`path is not directory: %s`, path)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user