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

Method WriteConfig

viper.go:1614–1620  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1612func WriteConfig() error { return v.WriteConfig() }
1613
1614func (v *Viper) WriteConfig() error {
1615 filename, err := v.getConfigFile()
1616 if err != nil {
1617 return err
1618 }
1619 return v.writeConfig(filename, true)
1620}
1621
1622// SafeWriteConfig writes current configuration to file only if the file does not exist.
1623func SafeWriteConfig() error { return v.SafeWriteConfig() }

Callers 2

TestWriteHiddenFileFunction · 0.80
WriteConfigFunction · 0.80

Calls 2

getConfigFileMethod · 0.95
writeConfigMethod · 0.95

Tested by 1

TestWriteHiddenFileFunction · 0.64