summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2017-07-26 10:26:59 +0100
committerKatolaZ <katolaz@freaknet.org>2017-07-26 10:26:59 +0100
commit3fcaf22bbb9425f2f393dcbba492912a8a246f92 (patch)
tree356ce72981677d500d05c6aa0b9613ec39f764a7 /config.go
parente6af4d1a5ce976fb74c70760675f7f31767f734d (diff)
A first go at gometalinter :-)
Diffstat (limited to 'config.go')
-rw-r--r--config.go9
1 files changed, 3 insertions, 6 deletions
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)