// Remove specific Job by function
//
// Removing a job stops that job's timer. However, if a job has already
// been started by by the job's timer before being removed, there is no way to stop
// it through gocron as https://pkg.go.dev/time#Timer.Stop explains.
// The job function would need to have implemented a means of
// stopping, e.g. using a context.WithCancel().
Remove specific Job by function

Removing a job stops that job's timer.
// Remove specific Job by function // // Removing a job stops that job ' s timer . However if a job has already // been started by by the job ' s timer before being removed there is no way to stop // it through gocron as https : // pkg . go . dev / time#Timer . Stop explains . // The job function would need to have implemented a means of // stopping e . g . using a context . WithCancel () .
func (s *Scheduler) Remove(job interface{}) {
	fName := getFunctionName(job)
	j := s.findJobByTaskName(fName)
	s.removeJobsUniqueTags(j)
	s.removeByCondition(func(someJob *Job) bool {
		return someJob.name == fName
	})
}
func ( s * Scheduler ) Remove ( job interface { } ) { fName := getFunctionName ( job ) j := s . findJobByTaskName ( fName ) s . removeJobsUniqueTags ( j ) s . removeByCondition ( func ( someJob * Job ) bool { return someJob . name == fName } ) }
Remove specific Job by function
Remove specific Job by function