MCPcopy
hub / github.com/spf13/viper / SetConfigName

Method SetConfigName

viper.go:2004–2013  ·  view source on GitHub ↗
(in string)

Source from the content-addressed store, hash-verified

2002func SetConfigName(in string) { v.SetConfigName(in) }
2003
2004func (v *Viper) SetConfigName(in string) {
2005 if v.finder != nil {
2006 v.logger.Warn("ineffective call to function: custom finder takes precedence", slog.String("function", "SetConfigName"))
2007 }
2008
2009 if in != "" {
2010 v.configName = in
2011 v.configFile = ""
2012 }
2013}
2014
2015// SetConfigType sets the type of the configuration returned by the
2016// remote source, e.g. "json".

Callers 14

TestGetConfigFileFunction · 0.80
TestReadInConfigFunction · 0.80
TestDirsSearchFunction · 0.80
TestWriteConfigFunction · 0.80
TestWriteConfigTOMLFunction · 0.80
TestWriteConfigDotEnvFunction · 0.80
TestSafeWriteConfigFunction · 0.80
TestWriteHiddenFileFunction · 0.80

Calls 1

StringMethod · 0.80

Tested by 13

TestGetConfigFileFunction · 0.64
TestReadInConfigFunction · 0.64
TestDirsSearchFunction · 0.64
TestWriteConfigFunction · 0.64
TestWriteConfigTOMLFunction · 0.64
TestWriteConfigDotEnvFunction · 0.64
TestSafeWriteConfigFunction · 0.64
TestWriteHiddenFileFunction · 0.64