pelletier/go-toml — pull request #17 by eanderton (2014-07-08 01:22:58+00:00)
Title: TOML v0.2.0 Group Array Support and ToString Feature

I needed some additional features for my Grapnel project, so I went ahead and coded them up. I have enjoyed using your library, so I'm more than happy to contribute that code back. I hope the changes included here find you well.

* Group Arrays, per the v0.2.0 specification are implemented as []*TomlTree arrays within a given tree
* Toml.GetPath() and Toml.Get() now return the root node if there is an empty path
* Toml.ToString() emits valid TOML output for a TomlTree instance
* Added test cases for all of the above

The ToString() support was a product of needing some nicer eval facilities while implementing the other features. It seems to fit into the library pretty well, so I included it. Please let me know if you'd like to see that on a distinct merge request.

The only major wart in this implementation is that GetPath() does nothing fancy with the new Group Arrays. It's possible to use GetPath to query a Group Array by name, as a whole. It's not possible to select individual Group Array elements or keys inside those elements, from GetPath(); this is no different than trying to select into array values.