dependabot[bot]
a0be52f4c1
build(deps): bump actions/upload-artifact from 6 to 7 ( #1036 )
2026-03-03 00:47:35 -05:00
Thomas Pelletier
316bfc66a4
Support Unmarshaler interface for tables and array tables ( #1027 )
...
Fixes #873
Extend the unstable.Unmarshaler interface support to work with tables
and array tables, not just single values.
When a type implementing unstable.Unmarshaler is the target of a table
(e.g., [table] or [[array]]), the UnmarshalTOML method receives a
synthetic InlineTable node containing all the key-value pairs belonging
to that table.
Key changes:
- Add handleKeyValuesUnmarshaler to collect and process table content
- Add copyExpressionNodes to deep-copy AST nodes for synthetic tables
- Add helper functions in unstable/ast.go for node manipulation
- Update documentation for EnableUnmarshalerInterface
- Add comprehensive tests for table and array table unmarshaling
* Implement bytes-based Unmarshaler interface for tables and arrays (#873 )
This change brings back support for the unstable.Unmarshaler interface
for tables and array tables, addressing issue #873 .
Key changes:
- Changed UnmarshalTOML signature from (*Node) to ([]byte) to provide
raw TOML bytes instead of AST nodes
- Added RawMessage type (similar to json.RawMessage) for capturing raw
TOML bytes for later processing
- Updated handleKeyValuesUnmarshaler to reconstruct key-value lines
from the parsed keys and raw value bytes
- Added support for slice types implementing Unmarshaler (e.g., RawMessage)
- Removed unused AST helper functions from unstable/ast.go
The bytes-based interface allows users to:
- Get raw TOML bytes for custom parsing
- Delay TOML decoding using RawMessage
- Implement custom unmarshaling logic for complex types
Tests added for:
- Table unmarshaler with various scenarios
- Array table unmarshaler
- Split tables (same parent defined in multiple places)
- RawMessage usage
- Nested tables and mixed regular fields
* Fix lint issues and improve test coverage for Unmarshaler interface
- Apply De Morgan's law in keyNeedsQuoting to satisfy staticcheck QF1001
- Remove unused splitTableUnmarshaler type from test
- Fix unused parameter lint warning in errorUnmarshaler873
- Add test for quoted keys that need special handling
- Add test for error propagation from UnmarshalTOML
- Update customTable873 parser to handle quoted keys properly
Coverage improved:
- handleKeyValuesUnmarshaler: 80.0% -> 93.3%
- keyNeedsQuoting: 66.7% -> 83.3%
- Overall main package: 97.2% -> 97.5%
* Add test for dotted keys to improve coverage
Add TestIssue873_DottedKeys to test dotted key handling (e.g., sub.key = value)
in the Unmarshaler interface. This improves coverage for handleKeyValuesUnmarshaler
from 93.3% to 96.7%.
* Add double pointer test to achieve 100% coverage for handleKeyValues
Add TestIssue873_DoublePointerUnmarshaler to test pointer-to-pointer
to Unmarshaler types. This covers the pointer dereferencing loop in
handleKeyValues, bringing its coverage from 88% to 100%.
Total coverage: 97.4%
* Add Example tests and fix raw value extraction for boolean types
Add two godoc Example tests:
- ExampleDecoder_EnableUnmarshalerInterface_dynamicConfig: shows dynamic
unmarshaling based on a type field
- ExampleDecoder_EnableUnmarshalerInterface_rawMessage: demonstrates
RawMessage usage for deferred parsing
Fix handleKeyValuesUnmarshaler to handle values where Raw.Length == 0
(like boolean types) by using value.Data as fallback.
* Preserve original formatting in Unmarshaler by using raw byte ranges
Instead of reconstructing key-value lines from parsed components, now
uses the original raw bytes from the document. This preserves:
- Whitespace around '=' (e.g., "key = value")
- String quoting style (basic vs literal)
- Number formats (hex, octal, binary)
- Inline table formatting
Changes:
- Add Raw range tracking to KeyValue expressions in parseKeyval
- Update handleKeyValuesUnmarshaler to use expr.Raw directly
- Remove keyNeedsQuoting helper (no longer needed)
- Add TestIssue873_FormattingPreservation test
- Update expected output in ExampleParser_comments
* Prevent test matrix from canceling on first failure
Add fail-fast: false to the test workflow strategy so that all
OS/Go version combinations continue running even if one fails.
This provides better visibility into which specific combinations
have issues.
---------
Co-authored-by: Claude <noreply@anthropic.com >
2026-02-11 09:57:23 -05:00
Thomas Pelletier
003aa0993b
Fix nil pointer map values not being marshaled ( #1025 )
...
When marshaling a map with nil pointer values, the keys were being
silently dropped, breaking round-trip fidelity. For example:
map[string]*struct{}{"foo": nil}
Would produce an empty TOML document instead of "[foo]".
This change converts nil pointer values in maps to their zero values
(consistent with how nil pointers in slices are handled), allowing the
keys to be preserved as empty tables.
Nil interface values (map[string]any{"foo": nil}) are still skipped
since there's no type information to derive a zero value.
Fixes #975
Also, pin golangci-lint version to v2.8.0 in CI and document in AGENTS.md
- Explicitly set golangci-lint version in lint.yml to ensure consistent
behavior across CI runs
- Update AGENTS.md with instructions to use the same linter version locally
---------
Co-authored-by: Claude <noreply@anthropic.com >
2026-01-09 11:08:31 -05:00
dependabot[bot]
84d730b6c4
build(deps): bump golangci/golangci-lint-action from 8 to 9 ( #1022 )
2026-01-05 21:23:56 -05:00
dependabot[bot]
97bd897177
build(deps): bump actions/setup-go from 5 to 6 ( #1023 )
2026-01-05 21:23:35 -05:00
dependabot[bot]
7924b1816f
build(deps): bump actions/checkout from 5 to 6 ( #1024 )
2026-01-05 21:23:15 -05:00
Thomas Pelletier
2a07b6d9db
Update to Go 1.25 ( #1018 )
...
Update CI workflows to test against Go 1.24 and 1.25, and use Go 1.25 for
coverage and release builds.
## Benchstat Report: Go 1.24 vs Go 1.25
Benchmark comparison between Go 1.24.7 and Go 1.25.1 (10 runs each):
### Execution Time (sec/op)
| Benchmark | Go 1.24 | Go 1.25 | Delta |
|-----------|---------|---------|-------|
| UnmarshalDataset/config | 26.25ms | 26.00ms | ~ (p=0.280) |
| UnmarshalDataset/canada | 88.71ms | 84.94ms | **-4.26%** ✅ |
| UnmarshalDataset/citm_catalog | 33.71ms | 34.06ms | ~ (p=0.684) |
| UnmarshalDataset/twitter | 17.19ms | 17.33ms | ~ (p=0.971) |
| UnmarshalDataset/code | 107.4ms | 108.1ms | ~ (p=0.393) |
| UnmarshalDataset/example | 237.9µs | 251.3µs | +5.64% |
| Unmarshal/SimpleDocument/struct | 872.3ns | 848.9ns | ~ (p=0.165) |
| Unmarshal/SimpleDocument/map | 1.191µs | 1.278µs | +7.31% |
| Unmarshal/ReferenceFile/struct | 57.14µs | 57.95µs | ~ (p=0.089) |
| Unmarshal/ReferenceFile/map | 87.89µs | 92.88µs | +5.69% |
| Unmarshal/HugoFrontMatter | 16.06µs | 15.95µs | ~ (p=0.529) |
| Marshal/SimpleDocument/struct | 536.5ns | 563.5ns | +5.03% |
| Marshal/SimpleDocument/map | 651.0ns | 675.1ns | +3.72% |
| Marshal/ReferenceFile/struct | 44.63µs | 50.84µs | +13.91% |
| Marshal/ReferenceFile/map | 51.58µs | 57.06µs | +10.61% |
| Marshal/HugoFrontMatter | 10.04µs | 10.57µs | +5.27% |
| **geomean** | 140.6µs | 145.1µs | +3.18% |
### Summary
- Notable improvement: UnmarshalDataset/canada shows a 4.26% speedup
- Memory allocation and allocation counts remain identical
- Some marshal operations show slight slowdowns (likely Go runtime changes)
Co-authored-by: Claude <noreply@anthropic.com >
2026-01-04 13:59:18 -05:00
Nathan Baulch
a675c6b3e2
Upgrade to golangci-lint v2 ( #1008 )
2026-01-04 09:54:29 -05:00
dependabot[bot]
180c6ba2ba
build(deps): bump actions/setup-go from 5 to 6 ( #1002 )
...
Bumps [actions/setup-go](https://github.com/actions/setup-go ) from 5 to 6.
- [Release notes](https://github.com/actions/setup-go/releases )
- [Commits](https://github.com/actions/setup-go/compare/v5...v6 )
---
updated-dependencies:
- dependency-name: actions/setup-go
dependency-version: '6'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-03 20:43:53 -05:00
dependabot[bot]
dafc4173ef
build(deps): bump github/codeql-action from 3 to 4 ( #1006 )
...
Bumps [github/codeql-action](https://github.com/github/codeql-action ) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases )
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md )
- [Commits](https://github.com/github/codeql-action/compare/v3...v4 )
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-version: '4'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-03 20:43:43 -05:00
dependabot[bot]
f1a83be671
build(deps): bump actions/upload-artifact from 4 to 6 ( #1011 )
...
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact ) from 4 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases )
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v6 )
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-version: '6'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-03 20:43:33 -05:00
dependabot[bot]
5aeb70b3f0
build(deps): bump actions/checkout from 5 to 6 ( #1010 )
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/checkout/compare/v5...v6 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-version: '6'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-03 20:43:20 -05:00
dependabot[bot]
a0e8464967
build(deps): bump actions/checkout from 4 to 5 ( #1001 )
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/checkout/compare/v4...v5 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-version: '5'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-26 09:53:08 +02:00
Thomas Pelletier
644602b845
Script to test all versions of go ( #1000 )
2025-08-24 12:40:29 +02:00
Nathan Baulch
36df8eef6e
General cleanup ( #999 )
2025-08-24 12:18:46 +02:00
dependabot[bot]
098464b61b
build(deps): bump actions/checkout from 4 to 5 ( #993 )
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/checkout/compare/v4...v5 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-version: '5'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-21 08:10:55 +02:00
Thomas Pelletier
ee07c9203b
Update to go 1.24 ( #982 )
2025-04-07 07:11:38 -04:00
Thomas Pelletier
b730b2be5d
Bump testing to go 1.23 ( #961 )
2024-08-17 16:26:05 -04:00
Daniel Weiße
0977c05dd5
Update goreleaser action to v6 and set goreleaser binary to v2 ( #959 )
...
Signed-off-by: Daniel Weiße <dw@edgeless.systems >
2024-08-17 15:40:55 -04:00
dependabot[bot]
86608d7fca
build(deps): bump github/codeql-action from 2 to 3 ( #919 )
...
Bumps [github/codeql-action](https://github.com/github/codeql-action ) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases )
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md )
- [Commits](https://github.com/github/codeql-action/compare/v2...v3 )
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 13:24:46 -04:00
dependabot[bot]
4a1877957a
build(deps): bump actions/setup-go from 4 to 5 ( #916 )
...
Bumps [actions/setup-go](https://github.com/actions/setup-go ) from 4 to 5.
- [Release notes](https://github.com/actions/setup-go/releases )
- [Commits](https://github.com/actions/setup-go/compare/v4...v5 )
---
updated-dependencies:
- dependency-name: actions/setup-go
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 13:24:37 -04:00
dependabot[bot]
3021d6d033
build(deps): bump actions/upload-artifact from 3 to 4 ( #920 )
...
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact ) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases )
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4 )
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 13:24:24 -04:00
Thomas Pelletier
2b69615b5d
Go 1.22 support ( #935 )
2024-02-27 15:30:13 -05:00
Thomas Pelletier
2e087bdf5f
Run tests on macos/M1 ( #929 )
...
https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/
2024-01-30 19:15:50 -05:00
dependabot[bot]
dff0c128d0
build(deps): bump docker/login-action from 2 to 3 ( #901 )
...
Bumps [docker/login-action](https://github.com/docker/login-action ) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases )
- [Commits](https://github.com/docker/login-action/compare/v2...v3 )
---
updated-dependencies:
- dependency-name: docker/login-action
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-17 18:11:24 -04:00
dependabot[bot]
ae933f2e2a
build(deps): bump actions/checkout from 3 to 4 ( #896 )
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/checkout/compare/v3...v4 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-04 09:42:37 -04:00
michalbiesek
fac33d6fa8
Add support for Go 1.21 ( #885 )
...
* Add support for `Go 1.21`
Signed-off-by: Michal Biesek <michalbiesek@gmail.com >
* add go1.21 guard to fuzz_test.go
* ci: only build last two go versions
* fix workflow yaml syntax error
---------
Signed-off-by: Michal Biesek <michalbiesek@gmail.com >
Co-authored-by: Thomas Pelletier <thomas@pelletier.codes >
2023-08-20 19:47:04 +02:00
dependabot[bot]
654811fbc3
build(deps): bump actions/setup-go from 3 to 4 ( #859 )
...
Bumps [actions/setup-go](https://github.com/actions/setup-go ) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases )
- [Commits](https://github.com/actions/setup-go/compare/v3...v4 )
---
updated-dependencies:
- dependency-name: actions/setup-go
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-21 13:35:40 -04:00
Thomas Pelletier
c4a2eef8a4
Fix go 1.20 version in github actions ( #848 )
...
YAML interprets 1.20 as 1.2 without explicitely being a string.
2023-02-09 12:00:14 -05:00
Thomas Pelletier
b58c20aa49
Upgrade go 1.20 ( #847 )
...
Fixes #842
2023-02-08 18:59:58 -05:00
DavidKorczynski
58a592bbf8
ci: add CIFuzz integration ( #831 )
...
Signed-off-by: David Korczynski <david@adalogics.com >
2022-11-21 18:51:48 -05:00
dependabot[bot]
94bd3ddcd6
build(deps): bump actions/setup-go from 2 to 3 ( #820 )
...
Bumps [actions/setup-go](https://github.com/actions/setup-go ) from 2 to 3.
- [Release notes](https://github.com/actions/setup-go/releases )
- [Commits](https://github.com/actions/setup-go/compare/v2...v3 )
---
updated-dependencies:
- dependency-name: actions/setup-go
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-09 16:14:19 -05:00
Thomas Pelletier
67bc5422f3
Go 1.19 ( #802 )
2022-08-15 10:56:33 -04:00
dependabot[bot]
295a720dfb
build(deps): bump goreleaser/goreleaser-action from 2 to 3 ( #783 )
...
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action ) from 2 to 3.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases )
- [Commits](https://github.com/goreleaser/goreleaser-action/compare/v2...v3 )
---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-23 15:05:00 +02:00
dependabot[bot]
ba95863cd3
build(deps): bump docker/login-action from 1 to 2 ( #771 )
...
Bumps [docker/login-action](https://github.com/docker/login-action ) from 1 to 2.
- [Release notes](https://github.com/docker/login-action/releases )
- [Commits](https://github.com/docker/login-action/compare/v1...v2 )
---
updated-dependencies:
- dependency-name: docker/login-action
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-09 18:59:02 +02:00
dependabot[bot]
b24772942d
build(deps): bump github/codeql-action from 1 to 2 ( #764 )
...
Bumps [github/codeql-action](https://github.com/github/codeql-action ) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases )
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md )
- [Commits](https://github.com/github/codeql-action/compare/v1...v2 )
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-28 08:24:14 -04:00
dependabot[bot]
9501a05ed7
build(deps): bump actions/checkout from 2 to 3 ( #765 )
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/checkout/compare/v2...v3 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-28 08:23:56 -04:00
Thomas Pelletier
a97c9317d4
Go 1.18 ( #745 )
2022-03-23 10:26:12 -04:00
Thomas Pelletier
7ee3c8ff25
build: login to github repository
2022-01-01 09:24:52 -05:00
Thomas Pelletier
1e85aa6d78
build: add contents permissions
2021-12-31 20:47:50 -05:00
Thomas Pelletier
46fa3225e2
build: allows the token to write packages
2021-12-31 20:25:11 -05:00
Thomas Pelletier
5a1a96cb2d
build: pass the github token to goreleaser
2021-12-31 20:03:18 -05:00
Thomas Pelletier
ea9040ae83
build: change workflow reference to v2
2021-12-31 19:57:41 -05:00
Thomas Pelletier
2373685f1e
Docker + goreleaser ( #729 )
2021-12-31 19:55:31 -05:00
Thomas Pelletier
1b1dd3d6d5
Exclude testing PRs from release notes
2021-12-29 09:53:43 -05:00
Thomas Pelletier
19751e8a51
Missing performance section
2021-10-28 19:10:43 -04:00
Thomas Pelletier
925f214125
Add GitHub release configuration ( #644 )
2021-10-28 19:06:14 -04:00
Thomas Pelletier
69ab7e10d1
Go 1.17 release ( #574 )
...
Minimum supported version: Go 1.16.
2021-08-17 09:43:52 -04:00
Matthieu MOREL
9c24fbeaad
Set up Dependabot for GitHub actions and docker ( #570 )
2021-07-20 16:54:26 +02:00
Thomas Pelletier
d276c42adc
Run coverage test on branches only
2021-05-10 20:22:12 -04:00