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

A array of inline tables not unmarshalled correctly #106

Closed
bep opened this issue Oct 18, 2016 · 2 comments
Closed

A array of inline tables not unmarshalled correctly #106

bep opened this issue Oct 18, 2016 · 2 comments
Labels
bug Issues describing a bug in go-toml.

Comments

@bep
Copy link

bep commented Oct 18, 2016

Expected something other than []*toml.TomlTree in the example below:

package main

import (
    "fmt"
    "log"

    toml "github.com/pelletier/go-toml"
)

func main() {

    tml := `
    [params]
language_tabs = [
    { key = "shell", name = "Shell" },
    { key = "ruby", name = "Ruby" },
    { key = "python", name = "Python" }
]
`

    tree, err := toml.Load(tml)

    if err != nil {
        log.Fatal(err)
    }

    // fmt.Println(tree.String()) // Panics!
    m := tree.ToMap()

    fmt.Printf("%T\n", m["params"].(map[string]interface{})["language_tabs"])

    // => []*toml.TomlTree

}
``
@pelletier pelletier added the bug Issues describing a bug in go-toml. label Nov 23, 2016
@pelletier
Copy link
Owner

Thank you for the feedback, and sorry for the long wait time! Definitely a bug.

@pelletier
Copy link
Owner

Fixed in #110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues describing a bug in go-toml.
Projects
None yet
Development

No branches or pull requests

2 participants