Skip to content

Commit 8492c8d

Browse files
committed
refactor(encoding): rename new codec registries
Signed-off-by: Mark Sagi-Kazar <[email protected]>
1 parent a7f64b7 commit 8492c8d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

viper.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ type Viper struct {
184184

185185
logger *slog.Logger
186186

187-
encoderRegistry2 EncoderRegistry
188-
decoderRegistry2 DecoderRegistry
187+
encoderRegistry EncoderRegistry
188+
decoderRegistry DecoderRegistry
189189

190190
experimentalFinder bool
191191
experimentalBindStruct bool
@@ -211,8 +211,8 @@ func New() *Viper {
211211

212212
codecRegistry := codecRegistry{v: v}
213213

214-
v.encoderRegistry2 = codecRegistry
215-
v.decoderRegistry2 = codecRegistry
214+
v.encoderRegistry = codecRegistry
215+
v.decoderRegistry = codecRegistry
216216

217217
v.experimentalFinder = features.Finder
218218
v.experimentalBindStruct = features.BindStruct
@@ -1623,7 +1623,7 @@ func (v *Viper) unmarshalReader(in io.Reader, c map[string]any) error {
16231623

16241624
switch format := strings.ToLower(v.getConfigType()); format {
16251625
case "yaml", "yml", "json", "toml", "hcl", "tfvars", "ini", "properties", "props", "prop", "dotenv", "env":
1626-
decoder, err := v.decoderRegistry2.Decoder(format)
1626+
decoder, err := v.decoderRegistry.Decoder(format)
16271627
if err != nil {
16281628
return ConfigParseError{err}
16291629
}
@@ -1643,7 +1643,7 @@ func (v *Viper) marshalWriter(f afero.File, configType string) error {
16431643
c := v.AllSettings()
16441644
switch configType {
16451645
case "yaml", "yml", "json", "toml", "hcl", "tfvars", "ini", "prop", "props", "properties", "dotenv", "env":
1646-
encoder, err := v.encoderRegistry2.Encoder(configType)
1646+
encoder, err := v.encoderRegistry.Encoder(configType)
16471647
if err != nil {
16481648
return ConfigMarshalError{err}
16491649
}

0 commit comments

Comments
 (0)