Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/shiftlock/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func cmdCapabilities(args []string) error {

func cmdSecurity(args []string) error {
if len(args) == 0 || args[0] != "scan" {
return fmt.Errorf("usage: shiftlock security scan [-format text|json|sarif] [-production] ...")
return fmt.Errorf("usage: shiftlock security scan [-format text|json|sarif] [-production]")
}
fs := flag.NewFlagSet("security scan", flag.ExitOnError)
format := fs.String("format", "text", "text|json|sarif")
Expand Down Expand Up @@ -369,7 +369,7 @@ func cmdIncident(args []string) error {

func cmdSnapshot(args []string) error {
if len(args) == 0 {
return fmt.Errorf("usage: shiftlock snapshot create|diff ...")
return fmt.Errorf("usage: shiftlock snapshot create|diff")
}
switch args[0] {
case "create":
Expand Down
4 changes: 1 addition & 3 deletions resource/database/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"database/sql"
"errors"
"fmt"
"sync"
"sync/atomic"
"time"

Expand Down Expand Up @@ -52,8 +51,7 @@ type Config struct {

// Resource implements resource.Resource for PostgreSQL (or any SQL DB).
type Resource struct {
cfg Config
mu sync.Mutex
cfg Config
drained atomic.Bool
}

Expand Down
3 changes: 2 additions & 1 deletion resource/ratelimit/ratelimit_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ratelimit

import (
"context"
"testing"

"github.com/theworker02/shiftlock/resource"
Expand All @@ -26,7 +27,7 @@ func TestTokenBucket(t *testing.T) {
}
r.Release()
r.Release()
snap, _ := r.Snapshot(nil)
snap, _ := r.Snapshot(context.TODO())
if snap["rejected"] == "0" {
t.Fatal("expected rejection counted")
}
Expand Down
Loading