(w io.Writer)
| 1640 | func WriteConfigTo(w io.Writer) error { return v.WriteConfigTo(w) } |
| 1641 | |
| 1642 | func (v *Viper) WriteConfigTo(w io.Writer) error { |
| 1643 | format := strings.ToLower(v.getConfigType()) |
| 1644 | |
| 1645 | if !slices.Contains(SupportedExts, format) { |
| 1646 | return UnsupportedConfigError(format) |
| 1647 | } |
| 1648 | |
| 1649 | return v.marshalWriter(w, format) |
| 1650 | } |
| 1651 | |
| 1652 | // SafeWriteConfigAs writes current configuration to a given filename if it does not exist. |
| 1653 | func SafeWriteConfigAs(filename string) error { return v.SafeWriteConfigAs(filename) } |
no test coverage detected