From 3fcaf22bbb9425f2f393dcbba492912a8a246f92 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Wed, 26 Jul 2017 10:26:59 +0100 Subject: A first go at gometalinter :-) --- config.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'config.go') diff --git a/config.go b/config.go index 8cdd172..317940a 100644 --- a/config.go +++ b/config.go @@ -1,7 +1,6 @@ package main import ( - "fmt" "gopkg.in/yaml.v2" "io" "io/ioutil" @@ -11,16 +10,14 @@ import ( // Read a configuration from fname or die -func ReadGlobalConfig(fname string) *SCORSHmaster { +func readGlobalConfig(fname string) *SCORSHmaster { data, err := ioutil.ReadFile(fname) if err != nil { log.Fatal("Error while reading file: ", err) } - var cfg *SCORSHmaster - - cfg = new(SCORSHmaster) + var cfg = new(SCORSHmaster) // Unmarshal the YAML configuration file into a SCORSHcfg structure err = yaml.Unmarshal(data, cfg) @@ -28,7 +25,7 @@ func ReadGlobalConfig(fname string) *SCORSHmaster { log.Fatal("Error while reading configuration: ", err) } - fmt.Printf("%s", cfg) + //fmt.Printf("%s", cfg) if cfg.Logfile != "" { f, err := os.OpenFile(cfg.Logfile, os.O_APPEND|os.O_CREATE|os.O_RDWR, 0600) -- cgit v1.2.3