- Notifications
You must be signed in to change notification settings - Fork2.1k
Closed
Description
Preflight Checklist
- I have searched theissue tracker for an issue that matches the one I want to file, without success.
- I am not looking for support or already pursued the availablesupport channels without success.
- I have checked thetroubleshooting guide for my problem, without success.
Viper Version
1.20.0
Go Version
1.23
Config Source
Files
Format
YAML
Repl.it link
https://replit.com/@graffic/MergeInConfig-error
Code reproducing the issue
package mainimport ("github.com/spf13/viper")funcmain() {v:=viper.New()v.SetConfigFile("config.yaml")err:=v.MergeInConfig()iferr!=nil {panic(err)}}
Expected Behavior
I would expect that the configuration type detected inMergeInConfig
be given to MergeConfig or at least set so the call works.
Actual Behavior
MergeInConfig
already validates the configuration file extension, but a further call toMergeConfig
inside that method, checks for an already set configuration type and the call fails since there is none set.
Steps To Reproduce
See repl.it link
Additional Information
No response