Skip to content

Commit

Permalink
Satisfy linter (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 authored Sep 10, 2024
1 parent 594f6af commit 0f3ecad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/metal-api/internal/datastore/integer.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func makeRange(min, max uint) []integer {
a := make([]integer, max-min+1)
for i := range a {
a[i] = integer{
ID: min + uint(i),
ID: min + uint(i), // nolint:gosec
}
}
return a
Expand Down
4 changes: 0 additions & 4 deletions cmd/metal-api/internal/datastore/shared_mutex.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ type lockOptAcquireTimeout struct {
timeout time.Duration
}

func newLockOptAcquireTimeout(t time.Duration) *lockOptAcquireTimeout {
return &lockOptAcquireTimeout{timeout: t}
}

func (m *sharedMutex) lock(ctx context.Context, key string, expiration time.Duration, opts ...lockOpt) error {
timeout := defaultSharedMutexAcquireTimeout
for _, opt := range opts {
Expand Down
4 changes: 4 additions & 0 deletions cmd/metal-api/internal/datastore/shared_mutex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import (
r "gopkg.in/rethinkdb/rethinkdb-go.v6"
)

func newLockOptAcquireTimeout(t time.Duration) *lockOptAcquireTimeout {
return &lockOptAcquireTimeout{timeout: t}
}

func Test_sharedMutex_reallyLocking(t *testing.T) {
defer mutexCleanup(t)
ctx := context.Background()
Expand Down
4 changes: 2 additions & 2 deletions cmd/metal-api/internal/grpc/boot-service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestBootService_Register(t *testing.T) {
name string
uuid string
numcores int
memory int
memory uint64
dbsizes []metal.Size
dbmachines metal.Machines
neighbormac1 metal.MacAddress
Expand Down Expand Up @@ -121,7 +121,7 @@ func TestBootService_Register(t *testing.T) {
req := &v1.BootServiceRegisterRequest{
Uuid: tt.uuid,
Hardware: &v1.MachineHardware{
Memory: uint64(tt.memory),
Memory: tt.memory,
Disks: []*v1.MachineBlockDevice{
{
Size: 1000000000000,
Expand Down

0 comments on commit 0f3ecad

Please sign in to comment.