Skip to content

Commit 4ea5491

Browse files
committed
Avoid passing lock by value (driver.GidAllocator contains sync.Mutex)
1 parent de6807c commit 4ea5491

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/driver/gid_allocator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ type GidAllocator struct {
2020
mu sync.Mutex
2121
}
2222

23-
func NewGidAllocator() GidAllocator {
24-
return GidAllocator{}
23+
func NewGidAllocator() *GidAllocator {
24+
return &GidAllocator{}
2525
}
2626

2727
// Retrieves the next available GID

pkg/driver/provisioner_ap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
type AccessPointProvisioner struct {
2121
BaseProvisioner
2222
tags map[string]string
23-
gidAllocator GidAllocator
23+
gidAllocator *GidAllocator
2424
deleteAccessPointRootDir bool
2525
}
2626

0 commit comments

Comments
 (0)