diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-06-28 10:02:52 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-06-28 10:02:52 +0200 |
| commit | dba0b50e7863cf82c29969caed47da4b8c99ee05 (patch) | |
| tree | b57dde63e1ba2ef4fadb2d75a6ebe752cbb0a9fc | |
| parent | 7b4e273e539d93682dc87e9a7c7d1f79a4cd1b77 (diff) | |
dashboard/app: fix gometalinter warning
dashboard/app/api.go:390:28:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
| -rw-r--r-- | dashboard/app/api.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dashboard/app/api.go b/dashboard/app/api.go index 548e39349..1bd9be48d 100644 --- a/dashboard/app/api.go +++ b/dashboard/app/api.go @@ -377,7 +377,7 @@ nextBug: func addCommitsToBug(c context.Context, bug *Bug, manager string, managers []string, fixCommits []string, presentCommits map[string]bool) error { - if !bugNeedsCommitUpdate(c, bug, manager, fixCommits, presentCommits) { + if !bugNeedsCommitUpdate(c, bug, manager, fixCommits, presentCommits, true) { return nil } now := timeNow(c) @@ -387,7 +387,7 @@ func addCommitsToBug(c context.Context, bug *Bug, manager string, managers []str if err := datastore.Get(c, bugKey, bug); err != nil { return fmt.Errorf("failed to get bug %v: %v", bugKey.StringID(), err) } - if !bugNeedsCommitUpdate(nil, bug, manager, fixCommits, presentCommits) { + if !bugNeedsCommitUpdate(c, bug, manager, fixCommits, presentCommits, false) { return nil } if len(fixCommits) != 0 && !reflect.DeepEqual(bug.Commits, fixCommits) { @@ -438,9 +438,9 @@ func managerList(c context.Context, ns string) ([]string, error) { } func bugNeedsCommitUpdate(c context.Context, bug *Bug, manager string, fixCommits []string, - presentCommits map[string]bool) bool { + presentCommits map[string]bool, dolog bool) bool { if len(fixCommits) != 0 && !reflect.DeepEqual(bug.Commits, fixCommits) { - if c != nil { + if dolog { log.Infof(c, "bug %q is fixed with %q", bug.Title, fixCommits) } return true |
