Skip to content

Conversation

@patrickod
Copy link

CL 688815 contained a partial fix for the reported bug, but NewSignatureType contined to panic. This change relaxes it to permit construction of the type "func([]byte, B) []byte" where "type B []byte". We must do so because a client may instantiate the type "func([]byte, T...)" where [T string|[]byte] at T=B, and may have no way to know that they are dealing with this very special edge case of append.

Added a regression test of NewSignatureType, which I should have done in the earlier CL.

Also, make typestring less pedantic and fragile.

Updates tailscale/corp#31755

Change-Id: I3d8f8609582149f9c9f8402a04ad516c2c63bbc6

CL 688815 contained a partial fix for the reported bug, but
NewSignatureType contined to panic. This change relaxes it
to permit construction of the type "func([]byte, B) []byte"
where "type B []byte". We must do so because a client
may instantiate the type "func([]byte, T...)" where [T ~string|~[]byte]
at T=B, and may have no way to know that they are dealing
with this very special edge case of append.

Added a regression test of NewSignatureType, which I should
have done in the earlier CL.

Also, make typestring less pedantic and fragile.

Fixes golang#73871

Change-Id: I3d8f8609582149f9c9f8402a04ad516c2c63bbc6
@patrickod patrickod requested a review from awly August 28, 2025 17:11
Copy link
Member

@awly awly left a comment

Choose a reason for hiding this comment

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

@patrickod patrickod merged commit f3339c8 into tailscale.go1.25 Aug 28, 2025
4 checks passed
@patrickod patrickod deleted the patrickod/go-1.25-types-panic-fix branch August 28, 2025 17:33
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.

3 participants