Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: joshvanl <me@joshvanl.dev>
  • Loading branch information
JoshVanL committed Feb 24, 2025
1 parent 144c40c commit 52b38ee
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
20 changes: 10 additions & 10 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ schema = 3
version = "v22.5.0"
hash = "sha256-E2zXikbmIQImghstLUWuey1YgA0Folu3F+fi5k4hCxA="
[mod."github.com/dapr/kit"]
version = "v0.13.1-0.20241015130326-866002abe68a"
hash = "sha256-oFOuhoD8Bw3syQSwVqDT/Cokaj+8DTeeHqaJr12bHwQ="
version = "v0.15.1"
hash = "sha256-ZvwEsFf8phwBlLDZlG8otFdZiDu7vmkChbxhPs9KKS4="
[mod."github.com/davecgh/go-spew"]
version = "v1.1.2-0.20180830191138-d8f796af33cc"
hash = "sha256-fV9oI51xjHdOmEx6+dlq7Ku2Ag+m/bmbzPo6A4Y74qc="
Expand Down Expand Up @@ -170,20 +170,20 @@ schema = 3
version = "v1.27.0"
hash = "sha256-8655KDrulc4Das3VRduO9MjCn8ZYD5WkULjCvruaYsU="
[mod."golang.org/x/crypto"]
version = "v0.27.0"
hash = "sha256-8HP4+gr4DbXI22GhdgZmCWr1ijtI9HNLsTcE0kltY9o="
version = "v0.32.0"
hash = "sha256-4l8XyVfpunL7d03otqfx3ouG3qkSF+LT7VuH1K3oo2I="
[mod."golang.org/x/exp"]
version = "v0.0.0-20240909161429-701f63a606c0"
hash = "sha256-nB3zQGSyCNU9Z6QP0iYYBpUeu7HKBBXS1z9ba4DxjMQ="
[mod."golang.org/x/net"]
version = "v0.29.0"
hash = "sha256-dH9Rdf5T04KJ4B5WvIZh12ogMbADWiWgIt77nvPTk2k="
version = "v0.34.0"
hash = "sha256-AZOLY4MUNxxDw5ZQtO9dmY/YRo1gFW87YvpX/eLTy4Q="
[mod."golang.org/x/sys"]
version = "v0.25.0"
hash = "sha256-PXZ9EQZ7SFpcL7d3E1+KGTxziYlHEIZPfoXEbnaVD3I="
version = "v0.29.0"
hash = "sha256-qfsodJQ1H1CBI8yQWOvsXJgY5qHmiuw566HrrIseYHI="
[mod."golang.org/x/text"]
version = "v0.18.0"
hash = "sha256-aNvJW4gQs+MTfdz6DZqyyHQS2GJ9W8L8qKPVODPn4+k="
version = "v0.21.0"
hash = "sha256-QaMwddBRnoS2mv9Y86eVC2x2wx/GZ7kr2zAJvwDeCPc="
[mod."golang.org/x/time"]
version = "v0.6.0"
hash = "sha256-gW9TVK9HjLk52lzfo5rBzSunc01gS0+SG2nk0X1w55M="
Expand Down
3 changes: 3 additions & 0 deletions internal/queue/staging.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func (q *Queue) DeliverablePrefixes(ctx context.Context, prefixes ...string) (co
}

return func() {
// Must lock.
//nolint:errcheck
q.eventsLock.Lock(context.Background())
defer q.eventsLock.Unlock()

Expand All @@ -66,6 +68,7 @@ func (q *Queue) DeliverablePrefixes(ctx context.Context, prefixes ...string) (co
// the current count.
func (q *Queue) stage(counter counter.Interface) bool {
// Must lock.
//nolint:errcheck
q.eventsLock.Lock(context.Background())
defer q.eventsLock.Unlock()

Expand Down
3 changes: 3 additions & 0 deletions internal/queue/staging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func Test_DeliverablePrefixes(t *testing.T) {
staged: make(map[string]counter.Interface),
queue: queue.NewProcessor[string, counter.Interface](
func(counter counter.Interface) {
//nolint:errcheck
lock.Lock(context.Background())
defer lock.Unlock()
triggered = append(triggered, counter.JobName())
Expand All @@ -144,6 +145,7 @@ func Test_DeliverablePrefixes(t *testing.T) {
t.Cleanup(cancel)
assert.Equal(t, map[string]counter.Interface{"def123": counter3, "def234": counter4}, q.staged)
assert.EventuallyWithT(t, func(c *assert.CollectT) {
//nolint:errcheck
lock.Lock(context.Background())
defer lock.Unlock()
assert.ElementsMatch(c, []string{"abc123", "abc234", "xyz123", "xyz234"}, triggered)
Expand All @@ -154,6 +156,7 @@ func Test_DeliverablePrefixes(t *testing.T) {
t.Cleanup(cancel)
assert.Empty(t, q.staged)
assert.EventuallyWithT(t, func(c *assert.CollectT) {
//nolint:errcheck
lock.Lock(context.Background())
defer lock.Unlock()
assert.ElementsMatch(c, []string{"abc123", "abc234", "xyz123", "xyz234", "def123", "def234"}, triggered)
Expand Down

0 comments on commit 52b38ee

Please sign in to comment.