From ada4ac8e638d7831cdf8a6442604a5b2c96315cd Mon Sep 17 00:00:00 2001 From: xzyaoi Date: Tue, 25 Sep 2018 21:48:18 +0800 Subject: [PATCH] format --- cli/config.go | 11 +++++++---- cli/handler.go | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cli/config.go b/cli/config.go index c5cc7e64b..403568fb9 100644 --- a/cli/config.go +++ b/cli/config.go @@ -1,12 +1,12 @@ package main import ( - "os" "bytes" "github.com/BurntSushi/toml" "github.com/mitchellh/go-homedir" "io/ioutil" "log" + "os" "path/filepath" ) @@ -75,15 +75,18 @@ func getDefaultConfig() cvpmConfig { } func validateConfig() { - localConfig := readConfig() + // localConfig := readConfig() homepath, _ := homedir.Dir() // Validate CVPM Path cvpmPath := filepath.Join(homepath, "cvpm") exist, err := isPathExists(cvpmPath) + if err != nil { + log.Fatal(err) + } if !exist { - err:= os.Mkdir(cvpmPath, os.ModePerm) + err := os.Mkdir(cvpmPath, os.ModePerm) if err != nil { log.Fatal(err) } } -} \ No newline at end of file +} diff --git a/cli/handler.go b/cli/handler.go index 20d627b7e..1954fba31 100644 --- a/cli/handler.go +++ b/cli/handler.go @@ -8,12 +8,12 @@ import ( "github.com/olekukonko/tablewriter" "github.com/urfave/cli" "golang.org/x/crypto/ssh/terminal" - "syscall" "log" "os" "path/filepath" "strconv" "strings" + "syscall" ) func LoginHandler(c *cli.Context) User {