aboutsummaryrefslogtreecommitdiffhomepage
path: root/config
diff options
context:
space:
mode:
authorAnton Harniakou <[email protected]>2019-01-31 15:06:18 +0300
committerBjørn Erik Pedersen <[email protected]>2019-02-01 07:17:37 +0100
commitd9282cf98a346fcf98f363d9c353e4920ca85fc7 (patch)
tree440d1c8d3d5fc49f93c2df814003b75e84965ad6 /config
parentc52045bbb38cbf64b9cb39352230060aa122cc9f (diff)
downloadhugo-d9282cf98a346fcf98f363d9c353e4920ca85fc7.tar.gz
hugo-d9282cf98a346fcf98f363d9c353e4920ca85fc7.zip
Store supported config formats in a variable
Diffstat (limited to 'config')
-rw-r--r--config/configLoader.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/config/configLoader.go b/config/configLoader.go
index 31e3e00e4..f2265dc6a 100644
--- a/config/configLoader.go
+++ b/config/configLoader.go
@@ -20,6 +20,10 @@ import (
"github.com/spf13/viper"
)
+var (
+ ValidConfigFileExtensions = []string{"toml", "yaml", "yml", "json"}
+)
+
// FromConfigString creates a config from the given YAML, JSON or TOML config. This is useful in tests.
func FromConfigString(config, configType string) (Provider, error) {
v := newViper()