Skip to content

Commit 9c4f75b

Browse files
committed
Enable nofloats linter
1 parent 04a4f62 commit 9c4f75b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.golangci-kal.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ linters:
2323
#- "jsontags" # Ensure every field has a json tag.
2424
#- "maxlength" # Ensure all strings and arrays have maximum lengths/maximum items.
2525
#- "nobools" # Bools do not evolve over time, should use enums instead.
26-
#- "nofloats" # Ensure floats are not used.
26+
- "nofloats" # Ensure floats are not used.
2727
#- "optionalorrequired" # Every field should be marked as `+optional` or `+required`.
2828
# - "requiredfields" # Required fields should not be pointers, and should not have `omitempty`.
2929
- "statussubresource" # All root objects that have a `status` field should have a status subresource.

pkg/internal/rate/rate.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import (
3030
// Limit defines the maximum frequency of some events.
3131
// Limit is represented as number of events per second.
3232
// A zero Limit allows no events.
33+
//
34+
//nolint:kubeapilinter // This is an internal rate limiter implementation, not a Kubernetes API
3335
type Limit float64
3436

3537
// Inf is the infinite rate limit; it allows all events (even if burst is zero).
@@ -66,6 +68,8 @@ func Every(interval time.Duration) Limit {
6668
// or its associated context.Context is canceled.
6769
//
6870
// The methods AllowN, ReserveN, and WaitN consume n tokens.
71+
//
72+
//nolint:kubeapilinter // This is an internal rate limiter implementation, not a Kubernetes API
6973
type Limiter struct {
7074
mu sync.Mutex
7175
limit Limit
@@ -117,6 +121,8 @@ func (lim *Limiter) AllowN(now time.Time, n int) bool {
117121

118122
// A Reservation holds information about events that are permitted by a Limiter to happen after a delay.
119123
// A Reservation may be canceled, which may enable the Limiter to permit additional events.
124+
//
125+
//nolint:kubeapilinter // This is an internal rate limiter implementation, not a Kubernetes API
120126
type Reservation struct {
121127
ok bool
122128
lim *Limiter

0 commit comments

Comments
 (0)