Skip to content

Commit a4d96db

Browse files
committed
another linter fix
1 parent 3095dc1 commit a4d96db

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

database/spanner/spanner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ func (s *Spanner) Close() error {
153153
// Lock implements database.Driver but doesn't do anything because Spanner only
154154
// enqueues the UpdateDatabaseDdlRequest.
155155
func (s *Spanner) Lock() error {
156-
if swapped := s.lock.CAS(unlockedVal, lockedVal); swapped {
156+
if swapped := s.lock.CompareAndSwap(unlockedVal, lockedVal); swapped {
157157
return nil
158158
}
159159
return ErrLockHeld
160160
}
161161

162162
// Unlock implements database.Driver but no action required, see Lock.
163163
func (s *Spanner) Unlock() error {
164-
if swapped := s.lock.CAS(lockedVal, unlockedVal); swapped {
164+
if swapped := s.lock.CompareAndSwap(lockedVal, unlockedVal); swapped {
165165
return nil
166166
}
167167
return ErrLockNotHeld

database/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func GenerateAdvisoryLockId(databaseName string, additionalNames ...string) (str
2121

2222
// CasRestoreOnErr CAS wrapper to automatically restore the lock state on error
2323
func CasRestoreOnErr(lock *atomic.Bool, o, n bool, casErr error, f func() error) error {
24-
if !lock.CAS(o, n) {
24+
if !lock.CompareAndSwap(o, n) {
2525
return casErr
2626
}
2727
if err := f(); err != nil {

testing/testing.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"testing"
88
"time"
99

10-
dockertypes "github.com/docker/docker/api/types"
10+
"github.com/docker/docker/api/types/container"
1111
)
1212

1313
type IsReadyFunc func(Instance) bool
@@ -98,6 +98,6 @@ type Instance interface {
9898
Host() string
9999
Port() uint
100100
PortFor(int) uint
101-
NetworkSettings() dockertypes.NetworkSettings
101+
NetworkSettings() container.NetworkSettings
102102
KeepForDebugging()
103103
}

0 commit comments

Comments
 (0)