-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
kind/bugSomething isn't workingSomething isn't working
Description
Preflight Checklist
- I have searched the issue tracker for an issue that matches the one I want to file, without success.
- I am not looking for support or already pursued the available support channels without success.
- I have checked the troubleshooting guide for my problem, without success.
Viper Version
1.15.0
Go Version
1.17.8
Config Source
Environment variables
Format
Other (specify below)
Repl.it link
No response
Code reproducing the issue
func main(){
type C struct {
HOME string `mapstructure:"HOME"`
}
c := C{}
viper.AutomaticEnv()
err := viper.Unmarshal(&c)
if err != nil {
panic(err)
}
fmt.Println(c.HOME)
fmt.Println(viper.Get("HOME"))
}Expected Behavior
I want to get the value of home from the structure
output:
/Users/cy
/Users/cy
Actual Behavior
output:
/Users/cy
Steps To Reproduce
computer:
macOS Catalina version: 10.15.7(19h15)
MacBook Pro (15-inch, 2018)
Additional Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't workingSomething isn't working