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

quoted keys decoded with errors #78

Closed
zazab opened this issue Apr 2, 2015 · 2 comments
Closed

quoted keys decoded with errors #78

zazab opened this issue Apr 2, 2015 · 2 comments

Comments

@zazab
Copy link

zazab commented Apr 2, 2015

Here is the example:

package main

import "encoding/json"
import "fmt"
import "heaverd-mitm.build/src/.go/src/github.com/BurntSushi/toml"

const tomlString = `
"some.value" = "ang if this"
Key = "here it is"
`

func main() {
    const tomlString = `
key = "first"
"quoted.key" = "second"
["quoted.table"]
    key = "third"
`
    var conf interface{}
    toml.Decode(tomlString, &conf)
    result, _ := json.MarshalIndent(conf, "", "\t")
    fmt.Println("decoded:", string(result))
}

We got this:

decoded: {
    "\"quoted": {
        "table\"": {
            "key": "third"
        }
    },
    "\"quoted.key\"": "second",
    "key": "first"
}

But should get this:

decoded: {
    "quoted.table": {
        "key": "third"
    },
    "quoted.key": "second",
    "key": "first"
}
@zazab
Copy link
Author

zazab commented Apr 2, 2015

Sorry, got wrong import path. With updated toml all works as expected. Can be closed

@emilevauge
Copy link

Hi! Is it me or the current version does not support dots in quoted keys? I'm using version bd2bdf7f18f849530ef7a1c29a4290217cab32a1 and impossible to make it work.

ebrady pushed a commit to dvln/toml that referenced this issue Oct 24, 2016
Remove unnecessary pointer receivers for Position and QueryResult
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

3 participants