diff --git a/pkg/fanal/image/daemon/image.go b/pkg/fanal/image/daemon/image.go index 3409e278d1c7..d650851ad242 100644 --- a/pkg/fanal/image/daemon/image.go +++ b/pkg/fanal/image/daemon/image.go @@ -226,7 +226,7 @@ func (img *image) imageConfig(config *container.Config) v1.Config { } if len(config.ExposedPorts) > 0 { - c.ExposedPorts = make(map[string]struct{}) + c.ExposedPorts = make(map[string]struct{}) //nolint: gocritic for port := range config.ExposedPorts { c.ExposedPorts[port.Port()] = struct{}{} } diff --git a/pkg/set/unsafe.go b/pkg/set/unsafe.go index 2dd8bd3bbb35..261492045715 100644 --- a/pkg/set/unsafe.go +++ b/pkg/set/unsafe.go @@ -8,7 +8,7 @@ import ( // unsafeSet represents a non-thread-safe set implementation // WARNING: This implementation is not thread-safe -type unsafeSet[T comparable] map[T]struct{} +type unsafeSet[T comparable] map[T]struct{} //nolint: gocritic // New creates a new empty non-thread-safe set with optional initial values func New[T comparable](values ...T) Set[T] { diff --git a/pkg/set/unsafe_test.go b/pkg/set/unsafe_test.go index b3bdfa353fe7..8f42c01666ea 100644 --- a/pkg/set/unsafe_test.go +++ b/pkg/set/unsafe_test.go @@ -270,7 +270,7 @@ func Test_unsafeSet_Clear(t *testing.T) { got := s.Size() assert.Zero(t, got, "unexpected set size") - assert.Equal(t, 0, len(s.Items()), "items should be empty") + assert.Empty(t, s.Items(), "items should be empty") }) } }