Skip to content

fix: truncate existing JSON export files - #713

Open
Eljees wants to merge 1 commit into
wagoodman:mainfrom
Eljees:agent/truncate-json-export
Open

fix: truncate existing JSON export files#713
Eljees wants to merge 1 commit into
wagoodman:mainfrom
Eljees:agent/truncate-json-export

Conversation

@Eljees

@Eljees Eljees commented Jul 19, 2026

Copy link
Copy Markdown

Fixes #502

Summary

  • open JSON export files with O_TRUNC so a shorter report cannot leave stale bytes behind
  • add a regression test that overwrites a longer existing file and verifies the result is valid JSON

Test

  • go test ./cmd/dive/cli/internal/command/adapter

Signed-off-by: Eljees <yurytumanov.r@yandex.ru>
@Eljees
Eljees marked this pull request as ready for review July 26, 2026 20:35
@Eljees

Eljees commented Jul 28, 2026

Copy link
Copy Markdown
Author

Ping - small self-contained fix; happy to rebase or rework if there's interest.

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.

Truncate JSON output file

1 participant