Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, if you don't mind that it doesn't work correctly with slices: [0], then sure, you may return indices.

[0] https://go.dev/play/p/Q2ntuaugbGQ



That didn't work because you didn't pass the same slice in. You subsliced your things slice, which outputs a new slice.


It does work with slices as long as you use the slice to update as well




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: