task is a [] string
Delete is a secure delete method for task, and there are also Push and other methods..
for{
select{
case <-chan:
return
case <-time.After(time.Second * 5):
if(len(task) > 0){
arr := make([]string,len(task))
copy(arr,task)
for k, v := range arr{
....
task.Delete(k)
}
}
}
}
if you run this way for a period of time, you will get an error that task deletion is out of bounds.
what"s wrong with this code?