mirror of
https://github.com/avelino/awesome-go.git
synced 2024-11-13 11:14:37 -05:00
++
This commit is contained in:
parent
257a031f08
commit
0215981b89
1 changed files with 3 additions and 3 deletions
6
main.go
6
main.go
|
@ -118,17 +118,17 @@ func dropCreateDir(dir string) error {
|
||||||
|
|
||||||
func mkdirAll(path string) error {
|
func mkdirAll(path string) error {
|
||||||
_, err := os.Stat(path)
|
_, err := os.Stat(path)
|
||||||
// NOTE: directory is exists
|
// directory is exists
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: unknown error
|
// unexpected error
|
||||||
if !os.IsNotExist(err) {
|
if !os.IsNotExist(err) {
|
||||||
return fmt.Errorf("unexpected result of dir stat: %w", err)
|
return fmt.Errorf("unexpected result of dir stat: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: directory is not exists
|
// directory is not exists
|
||||||
if err := os.MkdirAll(path, 0755); err != nil {
|
if err := os.MkdirAll(path, 0755); err != nil {
|
||||||
return fmt.Errorf("midirAll: %w", err)
|
return fmt.Errorf("midirAll: %w", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue