Skip to content

refactor: drop ineffective omitempty - #356

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

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
@tenthirtyam
tenthirtyam force-pushed the refactor/drop-ineffective-omitempty branch from 26841c1 to ba5477b Compare August 12, 2026 18:09
@tenthirtyam
tenthirtyam force-pushed the refactor/drop-ineffective-omitempty branch from ba5477b to c8d28a7 Compare September 9, 2026 13:49
@tenthirtyam

Copy link
Copy Markdown
Contributor Author

@tanmay-hc - rebased and ready for review.

`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

Copy link
Copy Markdown
Contributor Author

Superseded by the consolidated cleanup PR: #377. Closing this in favor of that PR per maintainer request.

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