Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Refactor config Unmarshal methods.#271

Draft
PurelyApplied wants to merge 1 commit into
google:masterfrom
PurelyApplied:marshal
Draft

Refactor config Unmarshal methods.#271
PurelyApplied wants to merge 1 commit into
google:masterfrom
PurelyApplied:marshal

Conversation

@PurelyApplied
Copy link
Copy Markdown
Contributor

  • Use json.RawMessage to clean logic distinguishing literal and regexp matchers
  • Add tag validation that both key and value are set.

Fixes #<issue_number_goes_here>

It's a good idea to open an issue first for discussion.

  • Running against a large codebase such as Kubernetes does not error out. (See DEVELOPING.md for instructions on how to do that.)
  • Appropriate changes to README are included in PR

* Use json.RawMessage to clean logic distinguishing literal and regexp matchers
* Add tag validation that both key and value are set.
}
ft.Key = val
case "val", "value":
if ft.Key != "" {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obvious typo

Comment on lines +188 to +190
s.Package = vacuousMatcher{}
s.Type = vacuousMatcher{}
s.Field = vacuousMatcher{}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might read better as = nil, use != nil checks below, and update nil to vacuous during final validation. But it's a draft.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant