Skip to content

Make TagSet.Remove a no-op when contentType is nil#766

Merged
fxamacker merged 1 commit intomasterfrom
fxamacker/no-opt-to-remove-nil-type-in-tagset
Apr 26, 2026
Merged

Make TagSet.Remove a no-op when contentType is nil#766
fxamacker merged 1 commit intomasterfrom
fxamacker/no-opt-to-remove-nil-type-in-tagset

Conversation

@fxamacker
Copy link
Copy Markdown
Owner

Previously, syncTagSet.Remove() can panic if function parameter contentType is nil.

This PR adds an early return so Remove(nil) is a silent no-op, mirroring the behavior of Go's built-in delete() on a missing key.

Previously, syncTagSet.Remove() can panic if function parameter
contentType is nil.

This commit adds an early return so Remove(nil) is a silent no-op,
mirroring the behavior of Go's built-in delete() on a missing key.
@fxamacker fxamacker self-assigned this Apr 26, 2026
@fxamacker fxamacker merged commit 57f1601 into master Apr 26, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants