Merge pull request #89 from AlfHou/chore/fix-error-messages

Fix warnings reported by go-staticcheck
This commit is contained in:
Akhil Gupta
2022-07-12 17:23:07 +05:30
committed by GitHub
6 changed files with 18 additions and 20 deletions

View File

@@ -117,7 +117,7 @@ func UnshareVehicle(vehicleId, userId string) error {
return nil
}
if mapping.IsOwner {
return fmt.Errorf("Cannot unshare owner")
return fmt.Errorf("cannot unshare owner")
}
result := DB.Where("id=?", mapping.ID).Delete(&UserVehicle{})
return result.Error
@@ -365,8 +365,7 @@ func UnlockMissedJobs() {
if (job.Date == time.Time{}) {
continue
}
var duration time.Duration
duration = time.Duration(job.Duration)
var duration = time.Duration(job.Duration)
d := job.Date.Add(time.Minute * duration)
if d.Before(time.Now()) {
fmt.Println(job.Name + " is unlocked")