mirror of
https://github.com/spf13/viper
synced 2024-11-05 04:37:02 +00:00
Added "ConfigFileUsed" function
This commit is contained in:
parent
a54c415b55
commit
8b744a9310
2 changed files with 6 additions and 2 deletions
|
@ -80,14 +80,14 @@ validate. Viper is designed to work with YAML, TOML or JSON files. If someone
|
|||
really wants to add this feature, I’d be happy to merge it. It’s easy to
|
||||
specify which formats your application will permit.
|
||||
|
||||
Q: Why viper?
|
||||
Q: Why is it called "viper"?
|
||||
|
||||
A: Viper is designed to be a companion to
|
||||
[Cobra](http://github.com/spf13/cobra). While both can operate completely
|
||||
independently, together they make a powerful pair to handle much of your
|
||||
application foundation needs.
|
||||
|
||||
Q: Why Cobra?
|
||||
Q: Why is it called "Cobra"?
|
||||
|
||||
A: Is there a better name for a commander?
|
||||
|
||||
|
|
4
viper.go
4
viper.go
|
@ -46,6 +46,10 @@ func SetConfigFile(in string) {
|
|||
}
|
||||
}
|
||||
|
||||
func ConfigFileUsed() string {
|
||||
return configFile
|
||||
}
|
||||
|
||||
func AddConfigPath(in string) {
|
||||
if in != "" {
|
||||
absin := absPathify(in)
|
||||
|
|
Loading…
Reference in a new issue