github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/core/machinelock/export_test.go (about) 1 // Copyright 2018 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package machinelock 5 6 import "github.com/juju/mutex/v2" 7 8 func NewTestLock(config Config, acquire func(mutex.Spec) (mutex.Releaser, error)) (*lock, error) { 9 lock, err := New(config) 10 if lock != nil { 11 lock.acquire = acquire 12 } 13 return lock, err 14 }