Skip to content

refactor: drop ineffective omitempty - #356

Open
tenthirtyam wants to merge 1 commit into
hashicorp:mainfrom
tenthirtyam:refactor/drop-ineffective-omitempty
Open

refactor: drop ineffective omitempty#356
tenthirtyam wants to merge 1 commit into
hashicorp:mainfrom
tenthirtyam:refactor/drop-ineffective-omitempty

Conversation

@tenthirtyam

Copy link
Copy Markdown
Contributor

Description

encoding/json treats struct values as never empty, so json:",omitempty" on the embedded OnlyExcept field in PostProcessor and Provisioner has no effect.

Removes the misleading tags; OnlyExcept already applies omitempty to its Only and Except slice fields, and JSON output is unchanged.

Resolved Issues

encoding/json treats struct values as never empty, so json:",omitempty" on the embedded OnlyExcept field in PostProcessor and Provisioner has no effect.

Rollback Plan

Revery commit.

Changes to Security Controls

None.

@tenthirtyam
tenthirtyam requested a review from a team as a code owner August 3, 2026 23:52
`encoding/json` treats struct values as never empty, so `json:",omitempty"` on the embedded `OnlyExcept` field in `PostProcessor` and `Provisioner` has no effect.

Removes the misleading tags; `OnlyExcept `already applies `omitempty` to its `Only` and `Except` slice fields, and JSON output is unchanged.

Signed-off-by: Ryan Johnson <ryan@tenthirtyam.org>
@tenthirtyam
tenthirtyam force-pushed the refactor/drop-ineffective-omitempty branch from 26841c1 to ba5477b Compare August 12, 2026 18:09
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.

1 participant