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
package main
import (
"bytes""fmt""github.com/spf13/viper"
)
funcmain() {
vartomlExample1= []byte(`[something]la="one"`)
vartomlExample2= []byte(`[something]la.la="two"`)
vartomlExample3= []byte(`[something]"la.la"="three"`)
viper.SetConfigType("toml")
viper.ReadConfig(bytes.NewBuffer(tomlExample1))
fmt.Printf("%v\n",viper.AllKeys())
viper.ReadConfig(bytes.NewBuffer(tomlExample2))
fmt.Printf("%v\n",viper.AllKeys())
viper.ReadConfig(bytes.NewBuffer(tomlExample3))
fmt.Printf("%v\n",viper.AllKeys())
// From https://toml.io/en/v1.0.0#keys// Dotted keys are a sequence of bare or quoted keys joined with a dot. This allows for grouping similar properties together// Output:// [something.la]// []// [something.la.la]// Expected output:// [something.la]// [something.la.la]// [something.la.la]
}
Environment:
Viper version: v1.7.1
Config source: file
File format: TOML
Anything else we should know?:
The text was updated successfully, but these errors were encountered:
A maintainer will take a look at your issue shortly. 👀
In the meantime: We are working on Viper v2 and we would love to hear your thoughts about what you like or don't like about Viper, so we can improve or fix those issues.
📣 If you've already given us your feedback, you can still help by spreading the news,
either by sharing the above link or telling people about this on Twitter:
Expected behavior (what you expected to happen):
Unquoted TOML entries with a dot should be read properly:
section1.la.la
should readone
.Actual behavior (what actually happened):
Only
section2.la.la
will be available, notsection1.la.la
contrary to the TOML definition.Repl.it link:
https://replit.com/@gregszabo/TOMLExample3
Code reproducing the issue:
Environment:
Anything else we should know?:
The text was updated successfully, but these errors were encountered: