func (jb *jobBucket) removeJob(id check.ID) bool {
	jb.mu.Lock()
	defer jb.mu.Unlock()

	for i, c := range jb.jobs {
		if c.ID() == id {
			// delete the check from the jobs slice, making sure the backing array
			// doesn't keep a reference to the check, so that it can be GC'ed.
			// Logic from https://github.com/golang/go/wiki/SliceTricks
			copy(jb.jobs[i:], jb.jobs[i+1:])
			jb.jobs[len(jb.jobs)-1] = nil
			jb.jobs = jb.jobs[:len(jb.jobs)-1]
			return true
		}
	}
	return false
}
// removeJob removes the check from the bucket, and returns
// whether the check was indeed in the bucket (and therefore actually removed)
removeJob removes the check from the bucket, and returns
whether the check was indeed in the bucket (and therefore actually removed)
// removeJob removes the check from the bucket and returns // whether the check was indeed in the bucket ( and therefore actually removed )
func (jb *jobBucket) removeJob(id check.ID) bool {
	jb.mu.Lock()
	defer jb.mu.Unlock()
	for i, c := range jb.jobs {
		if c.ID() == id {
			copy(jb.jobs[i:], jb.jobs[i+1:])
			jb.jobs[len(jb.jobs)-1] = nil
			jb.jobs = jb.jobs[:len(jb.jobs)-1]
			return true
		}
	}
	return false
}
func ( jb * jobBucket ) removeJob ( id check . ID ) bool { jb . mu . Lock ( ) defer jb . mu . Unlock ( ) for i , c := range jb . jobs { if c . ID ( ) == id { copy ( jb . jobs [ i : ] , jb . jobs [ i + 1 : ] ) jb . jobs [ len ( jb . jobs ) - 1 ] = nil jb . jobs = jb . jobs [ : len ( jb . jobs ) - 1 ] return true } } return false }
removeJob removes the check from the bucket, and returns
whether the check was indeed in the bucket (and therefore actually removed)
removeJob removes the check from the bucket and returns whether the check was indeed in the bucket ( and therefore actually removed )
// delete the check from the jobs slice, making sure the backing array // doesn't keep a reference to the check, so that it can be GC'ed. // Logic from https://github.com/golang/go/wiki/SliceTricks