Fixes following review

This commit is contained in:
emile 2016-01-23 17:41:56 +01:00
parent 8adadaa5d4
commit f1b62b45f4
No known key found for this signature in database
GPG key ID: D808B4C167352E59
2 changed files with 13 additions and 8 deletions

View file

@ -1,16 +1,16 @@
package main
import (
"errors"
"fmt"
fmtlog "log"
"strings"
"time"
"fmt"
"github.com/emilevauge/traefik/provider"
"github.com/emilevauge/traefik/types"
"github.com/mitchellh/mapstructure"
"github.com/spf13/viper"
"github.com/wendal/errors"
"strings"
)
// GlobalConfiguration holds global configuration (with providers, etc.).
@ -97,8 +97,7 @@ func LoadConfiguration() *GlobalConfiguration {
viper.AddConfigPath("/etc/traefik/") // path to look for the config file in
viper.AddConfigPath("$HOME/.traefik/") // call multiple times to add many search paths
viper.AddConfigPath(".") // optionally look for config in the working directory
err := viper.ReadInConfig() // Find and read the config file
if err != nil { // Handle errors reading the config file
if err := viper.ReadInConfig(); err != nil {
fmtlog.Fatalf("Error reading file: %s", err)
}
if len(arguments.Certificates) > 0 {
@ -131,8 +130,7 @@ func LoadConfiguration() *GlobalConfiguration {
if arguments.boltdb {
viper.Set("boltdb", arguments.Boltdb)
}
err = unmarshal(&configuration)
if err != nil {
if err := unmarshal(&configuration); err != nil {
fmtlog.Fatalf("Error reading file: %s", err)
}

View file

@ -148,10 +148,17 @@ import:
ref: fca8c8854093a154ff1eb580aae10276ad6b1b5f
- package: github.com/spf13/cast
ref: ee7b3e0353166ab1f3a605294ac8cd2b77953778
- package: github.com/mitchellh/mapstructure
- package: github.com/spf13/jwalterweatherman
- package: github.com/spf13/pflag
- package: github.com/wendal/errors
- package: github.com/hashicorp/hcl
- package: github.com/kr/pretty
- package: github.com/magiconair/properties
- package: github.com/kr/text
- package: github.com/spf13/viper
ref: a212099cbe6fbe8d07476bfda8d2d39b6ff8f325
- package: github.com/spf13/cobra
subpackages:
- /cobra