diff options
Diffstat (limited to 'server/main.go')
-rw-r--r-- | server/main.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/server/main.go b/server/main.go index c597b2e..4f1cbd6 100644 --- a/server/main.go +++ b/server/main.go @@ -12,6 +12,7 @@ import ( "io/ioutil" "log" "net/http" + "os" "time" "golang.org/x/oauth2" @@ -203,9 +204,18 @@ func newState() string { return hex.EncodeToString(k) } +func readConfig(filename string) (*config.Config, error) { + f, err := os.Open(filename) + if err != nil { + return nil, err + } + defer f.Close() + return config.ReadConfig(f) +} + func main() { flag.Parse() - config, err := config.ReadConfig(*cfg) + config, err := readConfig(*cfg) if err != nil { log.Fatal(err) } |