From db54166991304220303ee1de8e06292c4c0a4e3c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 1 Jan 2023 17:41:03 -0700 Subject: lint: Turn on containedctx --- lib/textui/progress.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/textui/progress.go') diff --git a/lib/textui/progress.go b/lib/textui/progress.go index 7b3f63a..56fda96 100644 --- a/lib/textui/progress.go +++ b/lib/textui/progress.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Luke Shumaker +// Copyright (C) 2022-2023 Luke Shumaker // // SPDX-License-Identifier: GPL-2.0-or-later @@ -19,7 +19,7 @@ type Stats interface { } type Progress[T Stats] struct { - ctx context.Context + ctx context.Context //nolint:containedctx // captured for separate goroutine lvl dlog.LogLevel interval time.Duration -- cgit v1.2.3-2-g168b From 493ec396fab32d9e8859e34ad497fdb0a910a33c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 1 Jan 2023 17:49:11 -0700 Subject: lint: Turn on forcetypeassert --- lib/textui/progress.go | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/textui/progress.go') diff --git a/lib/textui/progress.go b/lib/textui/progress.go index 56fda96..68d986f 100644 --- a/lib/textui/progress.go +++ b/lib/textui/progress.go @@ -56,6 +56,7 @@ func (p *Progress[T]) Done() { } func (p *Progress[T]) flush(force bool) { + //nolint:forcetypeassert // It wasn't worth it to me (yet?) to make a typed wrapper around atomic.Value. cur := p.cur.Load().(T) if !force && cur == p.oldStat { return -- cgit v1.2.3-2-g168b