-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Closed
Labels
FrozenDueToAgeLanguageChangeSuggested changes to the Go languageSuggested changes to the Go languageProposalProposal-AcceptedProposal-FinalCommentPeriodearly-in-cycleA change that should be done early in the 3 month dev cycle.A change that should be done early in the 3 month dev cycle.
Milestone
Description
I recently tried to use the new #395 feature (for converting a slice to an array pointer: https://golang.org/cl/216424) in:
https://go-review.googlesource.com/c/go/+/322329
But in review, it was pointed out that it was a little ugly, as what I wanted to return was an array, which required a dereference:
return *(*[Size224]byte)(sum[:Size224])It would've been nicer if I could've just converted to an array instead:
return ([Size224]byte)(sum[:Size224])Talking to @ianlancetaylor and @griesemer, we couldn't remember great reasons for not also allowing this as part of #395. It does mean there's an subtle copy, but arguably the * dereference above is also a somewhat subtle copy.
Could we also add support for converting to the array?
katiehockman, bcmills, septemhill, dsnet, gqgs and 17 more
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeLanguageChangeSuggested changes to the Go languageSuggested changes to the Go languageProposalProposal-AcceptedProposal-FinalCommentPeriodearly-in-cycleA change that should be done early in the 3 month dev cycle.A change that should be done early in the 3 month dev cycle.