From d889647f0876dce43412872bbd64afc1a83cdb00 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 23 Jul 2018 15:00:37 +0200 Subject: [PATCH] Fix "passes lock by value" Signed-off-by: Knut Ahlers --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index fa3a38d..7b9800e 100644 --- a/main.go +++ b/main.go @@ -78,7 +78,7 @@ func (c *checkResult) AddDuration(d time.Duration) { c.Durations = append(c.Durations, d) } -func (c checkResult) DurationStats() string { +func (c *checkResult) DurationStats() string { c.lock.RLock() defer c.lock.RUnlock() @@ -104,7 +104,7 @@ func (c checkResult) DurationStats() string { ) } -func (c checkResult) Equals(r *checkResult) bool { +func (c *checkResult) Equals(r *checkResult) bool { return c.Status == r.Status && c.Message == r.Message }