Skip to content

Conversation

@chandler-solo
Copy link
Contributor

Description

While *string (and, without loss of generality, *bool) is technically comparable in Go (so MergeComparable compiles), the semantics are wrong:

  1. For *string, the zero value check src == t is just checking src == nil -- same as MergePointers
  2. It does not compare the actual string values; it compares addresses
  3. Two different *string pointers to the empty string wouldn't be equal

This is a cleanup only; there's no bug to fix.

Change Type

/kind cleanup

Changelog

NONE

Additional Notes

While *string (and, without loss of generality, *bool) is technically
comparable in Go (so it compiles), the semantics are wrong:

1. For *string, the zero value check src == t is just checking src == nil -- same as MergePointers
2. It does not compare the actual string values; it compares addresses
3. Two different *string pointers to the empty string wouldn't be equal

Signed-off-by: David L. Chandler <[email protected]>
@gateway-bot gateway-bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none labels Nov 25, 2025
Copy link
Contributor

@sheidkamp sheidkamp left a comment

Choose a reason for hiding this comment

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

nice catch

@chandler-solo
Copy link
Contributor Author

/merge

@gateway-bot gateway-bot added this pull request to the merge queue Nov 26, 2025
Merged via the queue into kgateway-dev:main with commit 73a8bff Nov 26, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants