mirror of
https://github.com/clearlinux/libnetwork.git
synced 2026-09-06 22:01:55 +00:00
Merge pull request #422 from kolyshkin/mkdirall
Simplify and fix os.MkdirAll() usage
This commit is contained in:
+1
-6
@@ -297,12 +297,7 @@ func (ep *endpoint) processOptions(options ...EndpointOption) {
|
||||
}
|
||||
|
||||
func createBasePath(dir string) error {
|
||||
err := os.MkdirAll(dir, 0644)
|
||||
if err != nil && !os.IsExist(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return os.MkdirAll(dir, 0644)
|
||||
}
|
||||
|
||||
func createFile(path string) error {
|
||||
|
||||
@@ -48,7 +48,7 @@ func init() {
|
||||
|
||||
func createBasePath() {
|
||||
err := os.MkdirAll(prefix, 0644)
|
||||
if err != nil && !os.IsExist(err) {
|
||||
if err != nil {
|
||||
panic("Could not create net namespace path directory")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user