# HG changeset patch # User Mikael Berthe # Date 1494540544 -7200 # Node ID d436b88d137b33b170ea19dfc799f2044f6eeaee # Parent 20d514540f3766b909b69c4ee6459dadcac2e256 Allow special configuration file "/dev/null" diff -r 20d514540f37 -r d436b88d137b cmd/root.go --- a/cmd/root.go Thu May 11 23:57:17 2017 +0200 +++ b/cmd/root.go Fri May 12 00:09:04 2017 +0200 @@ -169,6 +169,9 @@ // initConfig reads in config file and ENV variables if set. func initConfig() { + if cfgFile == "/dev/null" { + return + } if cfgFile != "" { // enable ability to specify config file via flag viper.SetConfigFile(cfgFile) }