You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the best solution is to make viper support syntax like viper.Set("person[0].detail.age", 29), use [] to represent that we wanna to change the element of which index is 0. To avoid the strange behavior.
Preflight Checklist
Viper Version
1.19.0
Go Version
1.23.3
Config Source
Files
Format
JSON
Repl.it link
No response
Code reproducing the issue
Expected Behavior
source config json file
after call function
this config file should be
Actual Behavior
source config json file
after call function
this config file was changed like this
Steps To Reproduce
1.create config.json in current project directory and input content
2.go run main.go
3.watch the config.json data
Additional Information
In some programming languages like JavaScript, maybe person[0] is same to person["0"], but the changed of 'data struct' maybe cause confused issues.
The text was updated successfully, but these errors were encountered: