From dba0b50e7863cf82c29969caed47da4b8c99ee05 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 28 Jun 2018 10:02:52 +0200 Subject: 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) --- dashboard/app/api.go | 8 ++++---- 1 file 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 -- cgit mrf-deployment