Skip to content

fix: truncate existing JSON export files#713

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

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>
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