Merge pull request #422 from kolyshkin/mkdirall

Simplify and fix os.MkdirAll() usage
This commit is contained in:
aboch
2015-08-04 09:29:53 -07:00
2 changed files with 2 additions and 7 deletions
+1 -6
View File
@@ -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 {
+1 -1
View File
@@ -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")
}