Skip to content

fix(export): return errors from configuration writes - #224

Merged
inhere merged 1 commit into
gookit:masterfrom
bensynapse:fix-export-write-errors
Oct 9, 2026
Merged

inhere merged 1 commit into
gookit:masterfrom
bensynapse:fix-export-write-errors

Conversation

@bensynapse

Copy link
Copy Markdown
Contributor

I run Live Tennis API.

DumpTo now returns the writer's error with its byte count. WriteTo and DumpToFile inherit that behavior.
Previously, failed or partial writes returned nil, so configuration exports appeared successful.

Eight regression cases check errors at zero, partial and full byte counts, plus successful output.
They also check error identity and the output newline. Six cases fail against the original implementation.

The full go test -race -coverprofile=profile.cov ./... suite passes on Go 1.21.13 and 1.23.4.
go build ./..., go vet ./... and go mod verify pass.
Staticcheck reports the same 190 existing findings as unchanged master. Revive reports the same 15 existing warnings.

@inhere
inhere merged commit 621a487 into gookit:master Oct 9, 2026
11 checks passed
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