Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicate key for object get first value #12

Closed
dlintw opened this issue Jul 11, 2019 · 2 comments
Closed

duplicate key for object get first value #12

dlintw opened this issue Jul 11, 2019 · 2 comments

Comments

@dlintw
Copy link
Contributor

dlintw commented Jul 11, 2019

sample.conf

server {
  addr: 239.0.0.1
  addr: 224.0.0.0
}

expect get server.addr is 224.0.0.0 but got 239.0.0.1

@artemkaxboy
Copy link
Contributor

I tried to reproduce the behavior with file and LoadConfig and with ParseString, but it gave me the last value as it supposed to.

conf1 := LoadConfig("tests/sample.conf")
val1 := conf1.GetString("server.addr", "")
log.Println(val1) // 2020/01/09 22:39:27 224.0.0.0

conf2 := ParseString(`server {addr: 239.0.0.1,addr: 224.0.0.0}`)
val2 := conf2.GetString("server.addr", "")
log.Println(val2) // 2020/01/09 22:39:27 224.0.0.0

Both examples give "224.0.0.0".

Can you give an example to reproduce the issue.

@dlintw
Copy link
Contributor Author

dlintw commented Jan 10, 2020

Sorry, I can't not reproduce it. too.

@dlintw dlintw closed this as completed Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants