diff --git a/config/clientconfignextgen_lock.go b/config/clientconfignextgen_lock.go index 2a173b4d..7afd4fcc 100644 --- a/config/clientconfignextgen_lock.go +++ b/config/clientconfignextgen_lock.go @@ -57,7 +57,7 @@ func ReleaseTanzuConfigNextGenLock() { if cfgNextGenLock == nil { return } - if errUnlock := cfgNextGenLock.Unlock(); errUnlock != nil { + if errUnlock := cfgNextGenLock.Close(); errUnlock != nil { panic(fmt.Sprintf("cannot release lock for tanzu config file, reason: %v", errUnlock)) } diff --git a/config/lock.go b/config/lock.go index 922bbfbe..84204c43 100644 --- a/config/lock.go +++ b/config/lock.go @@ -69,7 +69,7 @@ func ReleaseTanzuConfigLock() { if tanzuConfigLock == nil { return } - if errUnlock := tanzuConfigLock.Unlock(); errUnlock != nil { + if errUnlock := tanzuConfigLock.Close(); errUnlock != nil { panic(fmt.Sprintf("cannot release lock for tanzu config file, reason: %v", errUnlock)) } @@ -103,7 +103,7 @@ func getFileLockWithTimeOut(lockPath string, lockDuration time.Duration) (*filem select { case <-cancel: // Timed out, cleanup if necessary. - _ = flock.Unlock() + _ = flock.Close() case result <- err: } }() diff --git a/config/metadata_lock.go b/config/metadata_lock.go index 15309657..a13b8eed 100644 --- a/config/metadata_lock.go +++ b/config/metadata_lock.go @@ -57,7 +57,7 @@ func ReleaseTanzuMetadataLock() { if tanzuMetadataLock == nil { return } - if errUnlock := tanzuMetadataLock.Unlock(); errUnlock != nil { + if errUnlock := tanzuMetadataLock.Close(); errUnlock != nil { panic(fmt.Sprintf("cannot release lock for tanzu config metadata file, reason: %v", errUnlock)) }