The problem of golang array out of bounds

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?

Feb.28,2022

how Delete is safe.. Where do you lock it?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a787-2af5c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a787-2af5c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?