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

Adding TOML support #154

Merged
merged 2 commits into from
Jun 5, 2017
Merged

Adding TOML support #154

merged 2 commits into from
Jun 5, 2017

Conversation

hairyhenderson
Copy link
Owner

@hairyhenderson hairyhenderson commented Jun 4, 2017

This adds:

  • support for (unofficial) MIME application/toml for --datasource
  • TOML parsing for datasource function
  • new functions toml and toTOML

There's a catch though... It seems the library I'm using can't handle map[interface{}]interface{} like the YAML & JSON libraries do. So this fails:

$ gomplate -i '{{ `{"foo":{"bar":true}}` | json | toTOML }}'
2017/06/04 21:43:39 Unable to marshal map[foo:map[bar:%!s(bool=true)]]: toml: cannot encode a map with non-string key type

To work around this, I've patched the lib (see BurntSushi/toml#179) and am vendoring my branch until that's merged.

Signed-off-by: Dave Henderson dhenderson@gmail.com

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
@hairyhenderson hairyhenderson changed the title [WIP] Adding TOML support Adding TOML support Jun 5, 2017
@hairyhenderson hairyhenderson self-assigned this Jun 5, 2017
@hairyhenderson hairyhenderson merged commit 3837f48 into master Jun 5, 2017
@hairyhenderson hairyhenderson deleted the support-toml branch June 5, 2017 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant