blob: d4703570d09a404ca14a2bf4374902f037ecd5fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package confhelper
import (
"github.com/silvasur/simpleconf"
"log"
)
func ConfStringOrFatal(conf simpleconf.Config, section, key string) string {
s, err := conf.GetString(section, key)
if err != nil {
log.Fatalf("Could not read config value %s.%s: %s", section, key, err)
}
return s
}
func ConfIntOrFatal(conf simpleconf.Config, section, key string) int64 {
i, err := conf.GetInt(section, key)
if err != nil {
log.Fatalf("Could not read config value %s.%s: %s", section, key, err)
}
return i
}
|