Skip to content

Conversation

@barkyq
Copy link

@barkyq barkyq commented Jan 13, 2025

//
// The function returns early if no ETags are set (isSet is false) or if a wildcard (*) is used,
// in which case all ETags match. For multiple ETags, it checks each one until a match is found or all are checked.
func (val ConditionalMatch) MatchETag(etag string) (isSet bool, match bool, err error) {
Copy link
Author

Choose a reason for hiding this comment

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

rationale for returning isSet

the MatchETag function should check whether val.IsSet() is non-nil, otherwise it leads to the wrong behaviour.

this seemed the only reasonable solution (beyond implementors inspecting error types), and reduces boilerplate code for implementations.

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