From 576059b3fab5d307e26b3c04a4fb5fc3ad6d77db Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Wed, 24 Mar 2021 12:35:53 +0100 Subject: [PATCH] fix: apply staticcheck suggestions (#262) Preliminary work done as part of https://github.com/ooni/probe/issues/1299 --- internal/engine/experimentbuilder.go | 2 +- internal/engine/probeservices/benchselect.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/engine/experimentbuilder.go b/internal/engine/experimentbuilder.go index 994efc8..332e079 100644 --- a/internal/engine/experimentbuilder.go +++ b/internal/engine/experimentbuilder.go @@ -193,7 +193,7 @@ func canonicalizeExperimentName(name string) string { } func newExperimentBuilder(session *Session, name string) (*ExperimentBuilder, error) { - factory, _ := experimentsByName[canonicalizeExperimentName(name)] + factory := experimentsByName[canonicalizeExperimentName(name)] if factory == nil { return nil, fmt.Errorf("no such experiment: %s", name) } diff --git a/internal/engine/probeservices/benchselect.go b/internal/engine/probeservices/benchselect.go index 6ff54dd..4f1a77d 100644 --- a/internal/engine/probeservices/benchselect.go +++ b/internal/engine/probeservices/benchselect.go @@ -85,7 +85,7 @@ func (c *Candidate) try(ctx context.Context, sess Session) { } start := time.Now() testhelpers, err := client.GetTestHelpers(ctx) - c.Duration = time.Now().Sub(start) + c.Duration = time.Since(start) c.Err = err c.TestHelpers = testhelpers sess.Logger().Debugf("probe services: %+v: %+v %s", c.Endpoint, err, c.Duration)