Skip to content

deps: upgrade go-toml to v2.4.3 - #419

Merged
knadh merged 4 commits into
knadh:masterfrom
GreyXor:chore-upgrade-toml
Jul 28, 2026
Merged

deps: upgrade go-toml to v2.4.3#419
knadh merged 4 commits into
knadh:masterfrom
GreyXor:chore-upgrade-toml

Conversation

@GreyXor

@GreyXor GreyXor commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@knadh

knadh commented Jun 19, 2026

Copy link
Copy Markdown
Owner

hm, looks like there is a breaking change in how empty structures are treated in this version:

$ go test -v .
go: downloading github.com/pelletier/go-toml/v2 v2.4.0
=== RUN   TestTOML_Unmarshal
=== RUN   TestTOML_Unmarshal/Empty_TOML
    toml_test.go:73:
                Error Trace:    /home/kailash/code/go/my/knadh/koanf/parsers/toml/toml_test.go:73
                Error:          Not equal:
                                expected: map[string]interface {}(nil)
                                actual  : map[string]interface {}{}

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1,2 +1,3 @@
                                -(map[string]interface {}) <nil>
                                +(map[string]interface {}) {
                                +}

                Test:           TestTOML_Unmarshal/Empty_TOML
=== RUN   TestTOML_Unmarshal/Valid_TOML
=== RUN   TestTOML_Unmarshal/Invalid_TOML_-_missing_end_quotes
=== RUN   TestTOML_Unmarshal/Complex_TOML_-_All_types
=== RUN   TestTOML_Unmarshal/Invalid_TOML_-_missing_equal
--- FAIL: TestTOML_Unmarshal (0.00s)
    --- FAIL: TestTOML_Unmarshal/Empty_TOML (0.00s)
    --- PASS: TestTOML_Unmarshal/Valid_TOML (0.00s)
    --- PASS: TestTOML_Unmarshal/Invalid_TOML_-_missing_end_quotes (0.00s)
    --- PASS: TestTOML_Unmarshal/Complex_TOML_-_All_types (0.00s)
    --- PASS: TestTOML_Unmarshal/Invalid_TOML_-_missing_equal (0.00s)
=== RUN   TestTOML_Marshal
=== RUN   TestTOML_Marshal/Empty_TOML
    toml_test.go:135:
                Error Trace:    /home/kailash/code/go/my/knadh/koanf/parsers/toml/toml_test.go:135
                Error:          Not equal:
                                expected: []byte(nil)
                                actual  : []byte{}

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1,2 +1,3 @@
                                -([]uint8) <nil>
                                +([]uint8) {
                                +}

                Test:           TestTOML_Marshal/Empty_TOML
=== RUN   TestTOML_Marshal/Valid_TOML
=== RUN   TestTOML_Marshal/Complex_TOML_-_All_types
--- FAIL: TestTOML_Marshal (0.00s)
    --- FAIL: TestTOML_Marshal/Empty_TOML (0.00s)
    --- PASS: TestTOML_Marshal/Valid_TOML (0.00s)
    --- PASS: TestTOML_Marshal/Complex_TOML_-_All_types (0.00s)
FAIL
FAIL    github.com/knadh/koanf/parsers/toml/v2  0.003s
FAIL

@GreyXor

GreyXor commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

👍 thanks, I updated the two failing tests

@knadh

knadh commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Sorry, my point was that, between the two versions, the data type the toml lib returns has completely changed (breaking change). If we merge this as-is, it's bound to break koanf implementations out there that depend on the previous behaviour.

@GreyXor

GreyXor commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Sure @knadh, good catch indeed. I reverted the test and added a condition that preserve the old behavior. So the API is not silently altered anymore.

@GreyXor GreyXor changed the title deps: upgrade go-toml to v2.4.0 deps: upgrade go-toml to v2.4.2 Jul 1, 2026
@GreyXor GreyXor changed the title deps: upgrade go-toml to v2.4.2 deps: upgrade go-toml to v2.4.3 Jul 5, 2026
@GreyXor

GreyXor commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

hello @knadh , do we need something else to merge ?

@knadh
knadh merged commit 1aba4ed into knadh:master Jul 28, 2026
4 checks passed
@GreyXor
GreyXor deleted the chore-upgrade-toml branch July 28, 2026 13:26
@GreyXor

GreyXor commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants