From f927b1795ce0316a90a6ab7b0b022fe0dccd8602 Mon Sep 17 00:00:00 2001 From: Vlad Didenko Date: Tue, 3 Nov 2015 14:25:37 -0600 Subject: [PATCH] Fixes #32 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 754588f..915dff1 100644 --- a/README.md +++ b/README.md @@ -73,11 +73,14 @@ viper.SetDefault("Taxonomies", map[string]string{"tag": "tags", "category": "cat Viper requires minimal configuration so it knows where to look for config files. Viper supports JSON, TOML and YAML files. Viper can search multiple paths, but currently a single Viper instance only supports a single configuration file. +Viper does not default to any configuration search paths leaving defaults decision +to an application. ```go viper.SetConfigName("config") // name of config file (without extension) viper.AddConfigPath("/etc/appname/") // path to look for the config file in viper.AddConfigPath("$HOME/.appname") // 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 panic(fmt.Errorf("Fatal error config file: %s \n", err))