each iteration copies 1108 bytes (consider pointers or indexing)
48 continue
49 }
50
51 for _, job := range jobs.Items {52 // job.Name can be same for different jobs, so using job.Name+CreationTimeStamp for checking
53 // uniqueness of the job. so that duplicated messages to slack can be avoided
54 jobUniqueHash := job.Name + job.CreationTimestamp.String()
Description
Avoid for
loop range expressions that copy big objects for each iteration.
It is recommended to use index-based access or use pointers instead.
Bad practice
xs := make([][1024]byte, length)
for _, x := range xs {
// Loop body.
}
Recommended
xs := make([][1024]byte, length)
for i := range xs {
x := &xs[i]
// Loop body.
}