af00765ca07b2efa7b467d3707b24022a6e48dd6
* refactor(tracker): Remove unreachable return * refactor(unmarshal_imported_test): Mark unused camelCase test golangci-lint indicates `TestUnmarshalCamelCaseKey` as unused (it's currently skipped). * refactor(unmarshal_imported_test): Mark unused type golangci-lint indicates `customPointerMarshaler` as unused. * refactor(unmarshal_imported_test): Mark unused type golangci-lint indicates `textPointerMarshaler` as unused. * refactor(unmarshal_imported_test): Mark unused type golangci-lint indicates `precedentMarshaler` and its methods as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `testDurationToml2` as unused. * refactor(unmarshal_imported_test): Mark unused type golangci-lint indicates `testBadDuration` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `testDurationToml` as unused. * refactor(unmarshal_imported_test): Mark unused type golangci-lint indicates `testDuration` as unused. * refactor(unmarshal_imported_test): Mark unused type golangci-lint indicates `testDocCustomTag` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `testDocCustomTagData` as unused. * refactor(unmarshal_imported_test): Mark unused type golangci-lint indicates `testDocBasicsCustomTag` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `testDocBasicToml` as unused. * refactor(unmarshal_imported_test): Mark unused type golangci-lint indicates `structArrayNoTag` as unused. * refactor(unmarshal_imported_test): Mark unused type golangci-lint incorrectly indicates `check` as unused. * refactor(unmarshal_imported_test): Mark unused struct field golangci-lint indicates `testDoc.err` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `customMultilineTagTestToml` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `customCommentedTagTestToml` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `customCommentTagTestToml` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `customTagTestToml` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `mapsTestToml` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `mapsTestData` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `commentTestToml` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `nestedCustomMarshalerToml` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `nestedCustomMarshalerData` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `customMarshalerToml` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `mapTestDoc` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `quotedKeyMarshalTestToml` as unused. * refactor(unmarshal_imported_test): Mark unused var golangci-lint indicates `quotedKeyMarshalTestData` as unused.
go-toml V2
Development branch. Use at your own risk.
toml.Unmarshal()should work as well as v1.
Must do
Unmarshal
- Unmarshal into maps.
- Support Array Tables.
- Unmarshal into pointers.
- Support Date / times.
- Support struct tags annotations.
- Support Arrays.
- Support Unmarshaler interface.
- Original go-toml unmarshal tests pass.
- Benchmark!
- Abstract AST.
- Original go-toml testgen tests pass.
- Track file position (line, column) for errors.
- Strict mode.
Marshal
- Minimal implementation
Document
- Gather requirements and design API.
Ideas
- Allow types to implement a
ASTUnmarshalerinterface to unmarshal straight from the AST? - Rewrite AST to use a single array as storage instead of one allocation per node.
- Provide "minimal allocations" option that uses
unsafeto reuse the input byte array as storage for strings. - Cache reflection operations per type.
- Optimize tracker pass.
Differences with v1
License
The MIT License (MIT). Read LICENSE.
Description
Languages
Go
94.6%
Shell
5.4%