summaryrefslogtreecommitdiff
path: root/lib/containers/set.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-01 17:49:11 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-01 22:42:08 -0700
commit493ec396fab32d9e8859e34ad497fdb0a910a33c (patch)
treee174a7676cbe222b343004336b53e37cd37101a7 /lib/containers/set.go
parent95c8965e8b897aa69a3fbdea42c79513f55457ad (diff)
lint: Turn on forcetypeassert
Diffstat (limited to 'lib/containers/set.go')
-rw-r--r--lib/containers/set.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/containers/set.go b/lib/containers/set.go
index 67ba7ac..4fc8aad 100644
--- a/lib/containers/set.go
+++ b/lib/containers/set.go
@@ -1,4 +1,4 @@
-// Copyright (C) 2022 Luke Shumaker <lukeshu@lukeshu.com>
+// Copyright (C) 2022-2023 Luke Shumaker <lukeshu@lukeshu.com>
//
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -22,7 +22,10 @@ var (
_ lowmemjson.Decodable = (*Set[int])(nil)
)
-func cast[T any](x any) T { return x.(T) }
+func cast[T any](x any) T {
+ //nolint:forcetypeassert // Only called within a type switch.
+ return x.(T)
+}
func (o Set[T]) EncodeJSON(w io.Writer) error {
var less func(a, b T) bool