From 6941d28de5687235595c711773342baaea1dcc19 Mon Sep 17 00:00:00 2001 From: blacknon Date: Tue, 6 Feb 2018 21:46:39 +0900 Subject: [PATCH] conf check --- .DS_Store | Bin 6148 -> 6148 bytes conf/conf.go | 5 +++++ 2 files changed, 5 insertions(+) diff --git a/.DS_Store b/.DS_Store index 69918c95fbfa058f89b713c85ef229ed71fa050d..3203971c8468db3e0b55c55a2bea73e3a36fd4e3 100644 GIT binary patch delta 18 ZcmZoMXfc?OF!6-;#BNbW#*GV;#Q{YB2HXGu delta 18 ZcmZoMXfc?OF!7@H#BNbWhK&o8#Q{ZK2IK$$ diff --git a/conf/conf.go b/conf/conf.go index c95a89c2..287ad5d8 100644 --- a/conf/conf.go +++ b/conf/conf.go @@ -1,6 +1,7 @@ package conf import ( + "fmt" "os" "os/user" "strings" @@ -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 {