Fix issues found in gometalinter

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
This commit is contained in:
Madhu Rajanna
2019-01-28 19:29:16 +05:30
parent 008c82c1e7
commit 7a0c233c27
13 changed files with 136 additions and 38 deletions

View File

@ -27,7 +27,10 @@ import (
)
func init() {
flag.Set("logtostderr", "true")
if err := flag.Set("logtostderr", "true"); err != nil {
glog.Errorf("failed to set logtostderr flag: %v", err)
os.Exit(1)
}
}
var (
@ -64,10 +67,11 @@ func main() {
func createPersistentStorage(persistentStoragePath string) error {
if _, err := os.Stat(persistentStoragePath); os.IsNotExist(err) {
if err := os.MkdirAll(persistentStoragePath, os.FileMode(0755)); err != nil {
if err = os.MkdirAll(persistentStoragePath, os.FileMode(0755)); err != nil {
return err
}
} else {
return err
}
return nil
}