From daffeec30d9d67017ec84064e15fd946b0b0cb0d Mon Sep 17 00:00:00 2001 From: Cameron Moore Date: Thu, 6 Sep 2018 11:08:23 -0500 Subject: [PATCH] config: Fix golint issues config/configProvider.go:54:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) config/privacy/privacyConfig.go:99:1: exported function DecodeConfig should have comment or be unexported config/services/servicesConfig.go:64:1: exported function DecodeConfig should have comment or be unexported --- config/configProvider.go | 3 +-- config/privacy/privacyConfig.go | 1 + config/services/servicesConfig.go | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/configProvider.go b/config/configProvider.go index a7dc18960..432948d74 100644 --- a/config/configProvider.go +++ b/config/configProvider.go @@ -51,7 +51,6 @@ func GetStringSlicePreserveString(cfg Provider, key string) []string { sd := cfg.Get(key) if sds, ok := sd.(string); ok { return []string{sds} - } else { - return cast.ToStringSlice(sd) } + return cast.ToStringSlice(sd) } diff --git a/config/privacy/privacyConfig.go b/config/privacy/privacyConfig.go index 1eff528d5..ea34563eb 100644 --- a/config/privacy/privacyConfig.go +++ b/config/privacy/privacyConfig.go @@ -96,6 +96,7 @@ type YouTube struct { PrivacyEnhanced bool } +// DecodeConfig creates a privacy Config from a given Hugo configuration. func DecodeConfig(cfg config.Provider) (pc Config, err error) { if !cfg.IsSet(privacyConfigKey) { return diff --git a/config/services/servicesConfig.go b/config/services/servicesConfig.go index 17664407e..7306f5274 100644 --- a/config/services/servicesConfig.go +++ b/config/services/servicesConfig.go @@ -61,6 +61,7 @@ type Twitter struct { DisableInlineCSS bool } +// DecodeConfig creates a services Config from a given Hugo configuration. func DecodeConfig(cfg config.Provider) (c Config, err error) { m := cfg.GetStringMap(servicesConfigKey)