mirror of
https://github.com/spf13/viper
synced 2024-12-23 12:07:02 +00:00
Expose MarshalWriter publicly
This commit is contained in:
parent
15738813a0
commit
88c1d9fbd9
1 changed files with 5 additions and 3 deletions
8
viper.go
8
viper.go
|
@ -1329,11 +1329,13 @@ func (v *Viper) unmarshalReader(in io.Reader, c map[string]interface{}) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Marshal a map into Writer.
|
||||
func marshalWriter(f afero.File, configType string) error {
|
||||
// MarshalWriter will marshal a map into Writer for the default config
|
||||
func MarshalWriter(f afero.File, configType string) error {
|
||||
return v.marshalWriter(f, configType)
|
||||
}
|
||||
func (v *Viper) marshalWriter(f afero.File, configType string) error {
|
||||
|
||||
// MarshalWriter will marshal a map into Writer.
|
||||
func (v *Viper) MarshalWriter(f afero.File, configType string) error {
|
||||
c := v.AllSettings()
|
||||
switch configType {
|
||||
case "json":
|
||||
|
|
Loading…
Reference in a new issue