Why not something simple like: https://play.golang.org/p/iAlflMUdEA

On Monday, November 20, 2017 at 9:48:31 AM UTC-7, Trig wrote:
>
> for i, user := range myList {
>  if user.Disabled { 
>   myList = append(myList[:i], myList[i + 1:]...) // remove user from 
> return list 
>  } 
> }
>
>
> Is using append this way (to remove an index), inside of the range loop of 
> the same array I'm working with, safe... since the size of myList is being 
> changed within it?
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to