docs: new website

This commit is contained in:
Vikram Rangnekar
2020-05-17 03:11:56 -04:00
parent a1a47c905d
commit f6ce0c102b
31 changed files with 13232 additions and 9 deletions

View File

@ -156,7 +156,7 @@ func ReadInConfig(configFile string) (*Config, error) {
inherits := vi.GetString("inherits")
if len(inherits) != 0 {
if inherits != "" {
vi = newViper(cpath, inherits)
if err := vi.ReadInConfig(); err != nil {
@ -182,7 +182,7 @@ func ReadInConfig(configFile string) (*Config, error) {
return nil, fmt.Errorf("failed to decode config, %v", err)
}
if len(c.AllowListFile) == 0 {
if c.AllowListFile == "" {
c.AllowListFile = path.Join(cpath, "allow.list")
}
@ -196,7 +196,7 @@ func newViper(configPath, configFile string) *viper.Viper {
vi.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
vi.AutomaticEnv()
if len(filepath.Ext(configFile)) != 0 {
if filepath.Ext(configFile) != "" {
vi.SetConfigFile(configFile)
} else {
vi.SetConfigName(configFile)