sukeesh / k8s-job-notify

Found time.Now().Sub(t) instead of time.Since(t) SCC-S1012
Anti-pattern
Major
1 occurrence in this check
should use time.Since instead of time.Now().Sub
56				if level == "all" {
57					// Send success notifications.
58					if job.Status.Succeeded > 0 &&  (job.Status.CompletionTime.Add(20*time.Minute).Unix() > time.Now().Unix()) {
59						timeSinceCompletion := time.Now().Sub(job.Status.CompletionTime.Time).Minutes()60						err = slack.SendSlackMessage(message.JobSuccess(clusterName, job.Name, timeSinceCompletion))
61						if err != nil {
62							log.Fatalf("sending a message to slack failed %v", zap.Error(err))