Skip to content

Commit

Permalink
conf check
Browse files Browse the repository at this point in the history
  • Loading branch information
blacknon committed Feb 6, 2018
1 parent c5a6ade commit 6941d28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Binary file modified .DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions conf/conf.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package conf

import (
"fmt"
"os"
"os/user"
"strings"
Expand Down Expand Up @@ -33,6 +34,10 @@ type ServerConfig struct {
}

func ReadConf(confPath string) (checkConf Config) {
if isExist(confPath) == false {
fmt.Printf("Config file(%s) Not Found.\nPlease create file.", confPath)
os.Exit(1)
}
// Read Config
_, err := toml.DecodeFile(confPath, &checkConf)
if err != nil {
Expand Down

0 comments on commit 6941d28

Please sign in to comment.