Skip to content

Commit

Permalink
clean up more
Browse files Browse the repository at this point in the history
  • Loading branch information
edlitmus committed Aug 27, 2018
1 parent 7ee5c09 commit 74c2ad4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
)

// GSPConfig config data
type GSPConfig map[string]string
// type GSPConfig map[string]string

var gspConfig GSPConfig
// var gspConfig GSPConfig

var logger = logrus.New()

Expand Down Expand Up @@ -398,7 +398,7 @@ var appCommands = []cli.Command{
}

func main() {
readConfigFile()
gspConfig := readConfigFile()
if gspConfig != nil {
if gspConfig["default_key"] != "" {
defaultKeyName = gspConfig["default_key"]
Expand Down Expand Up @@ -483,7 +483,8 @@ func createConfigPath() string {
return configFile
}

func readConfigFile() {
func readConfigFile() map[string]string {
var gspConfig map[string]string
configFile := createConfigPath()
filename, err := filepath.Abs(configFile)
if err != nil {
Expand Down Expand Up @@ -513,4 +514,5 @@ func readConfigFile() {
logger.Warn("can't write default config file: %s", err)
}
}
return gspConfig
}

0 comments on commit 74c2ad4

Please sign in to comment.