Note that the linked code operates on a copy of each DoImpl so mutations won't be visible outside of DoSlice(): https://go.dev/play/p/sgRDQMcLow8
You can fix that by indexing into the slice instead: https://go.dev/play/p/0eA_pQ12jzl On Monday, March 28, 2022 at 5:11:47 PM UTC-4 s...@panix.com wrote: > In parallel discussion in the "generics" channel of the "Gophers" Slack > workspace, Roger Peppe was kind enough to point me > <https://gophers.slack.com/archives/C88U9BFDZ/p1648501157101109?thread_ts=1648490465.666939&cid=C88U9BFDZ> > to > an example of the structural type constraint > <https://go.dev/play/p/7_FgAij0xia> I was after. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/8f6766b2-72a7-4dd6-9344-167f941288b6n%40googlegroups.com.