Skip to content

Instantly share code, notes, and snippets.

@VojtechVitek
Last active September 16, 2019 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VojtechVitek/6e30a92ff8feefc9e3e7e7a9cd129199 to your computer and use it in GitHub Desktop.
Save VojtechVitek/6e30a92ff8feefc9e3e7e7a9cd129199 to your computer and use it in GitHub Desktop.
Comparison of TOML go packages
+ TOML v0.4.0
+ MIT license
- doesn't preserve comments
- no tree structure available for recursion
- data is burried in multi-level tree of map[string]interface{}
+ preserves order in the metadata.Keys() [][]string, not very intuitive to use the metadata properly (TODO: link to example)

^ the best pkg out there, even though it's not perfect

+ TOML v0.4.0
+ MIT license
- doesn't preserve comments (partial support only)
+ tree structure available for recursion; however data within tree leaves has no order (underlying map[string]interface{})
- roundtrip doesn't preserve original order, toml.OrderPreserve is not available on *toml.Tree when trying to 
+ TOML v0.4.0
+ MIT license
- doesn't preserve comments
- no tree structure available for recursion
+ MIT
- TOML v0.2.0
- BSD-2-Clause
- doesn't preserve order
- no API available for recursion or any advanced manipulation, has only plain ol' Marshal() and Unmarshal()
- too old, last commit 5 years ago
- TODO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment