From b41f6b51a9246fbd3dfbdc6544df9cc6341272b0 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 23 Oct 2019 16:06:42 +0200 Subject: [PATCH] bump gofrs/flock v0.7.1 full diff: https://github.com/gofrs/flock/compare/v0.7.0...v0.7.1 - gofrs/flock#34 don't mention sync.Locker in package documentation - fixes gofrs/flock#33 incorrect interface - gofrs/flock#35 Fix linting issues and add goreportcard badge Signed-off-by: Sebastiaan van Stijn Upstream-commit: ad4ca6f0d03115098a61e3fce86173f5bdf2ac6e Component: cli --- components/cli/vendor.conf | 2 +- components/cli/vendor/github.com/gofrs/flock/README.md | 1 + components/cli/vendor/github.com/gofrs/flock/flock.go | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/components/cli/vendor.conf b/components/cli/vendor.conf index c13b77db9d5..8a79584cfc5 100755 --- a/components/cli/vendor.conf +++ b/components/cli/vendor.conf @@ -27,7 +27,7 @@ github.com/docker/libtrust 9cbd2a1374f46905c68a4eb3694a github.com/docker/licensing 9781369abdb5281cdc07a2a446c6df01347ec793 github.com/docker/swarmkit 7dded76ec532741c1ad9736cd2bb6d6661f0a386 github.com/evanphx/json-patch 72bf35d0ff611848c1dc9df0f976c81192392fa5 # v4.1.0 -github.com/gofrs/flock 7f43ea2e6a643ad441fc12d0ecc0d3388b300c53 # v0.7.0 +github.com/gofrs/flock 392e7fae8f1b0bdbd67dad7237d23f618feb6dbb # v0.7.1 github.com/gogo/googleapis d31c731455cb061f42baff3bda55bad0118b126b # v1.2.0 github.com/gogo/protobuf ba06b47c162d49f2af050fb4c75bcbc86a159d5c # v1.2.1 github.com/golang/glog 23def4e6c14b4da8ac2ed8007337bc5eb5007998 diff --git a/components/cli/vendor/github.com/gofrs/flock/README.md b/components/cli/vendor/github.com/gofrs/flock/README.md index 42d580f71be..7375e72eeb4 100644 --- a/components/cli/vendor/github.com/gofrs/flock/README.md +++ b/components/cli/vendor/github.com/gofrs/flock/README.md @@ -2,6 +2,7 @@ [![TravisCI Build Status](https://img.shields.io/travis/gofrs/flock/master.svg?style=flat)](https://travis-ci.org/gofrs/flock) [![GoDoc](https://img.shields.io/badge/godoc-go--flock-blue.svg?style=flat)](https://godoc.org/github.com/gofrs/flock) [![License](https://img.shields.io/badge/license-BSD_3--Clause-brightgreen.svg?style=flat)](https://github.com/gofrs/flock/blob/master/LICENSE) +[![Go Report Card](https://goreportcard.com/badge/github.com/gofrs/flock)](https://goreportcard.com/report/github.com/gofrs/flock) `flock` implements a thread-safe sync.Locker interface for file locking. It also includes a non-blocking TryLock() function to allow locking without blocking execution. diff --git a/components/cli/vendor/github.com/gofrs/flock/flock.go b/components/cli/vendor/github.com/gofrs/flock/flock.go index 5783a49855d..8f109b8a967 100644 --- a/components/cli/vendor/github.com/gofrs/flock/flock.go +++ b/components/cli/vendor/github.com/gofrs/flock/flock.go @@ -2,7 +2,7 @@ // Use of this source code is governed by the BSD 3-Clause // license that can be found in the LICENSE file. -// Package flock implements a thread-safe sync.Locker interface for file locking. +// Package flock implements a thread-safe interface for file locking. // It also includes a non-blocking TryLock() function to allow locking // without blocking execution. // @@ -13,7 +13,7 @@ // guaranteed to be the same on each platform. For example, some UNIX-like // operating systems will transparently convert a shared lock to an exclusive // lock. If you Unlock() the flock from a location where you believe that you -// have the shared lock, you may accidently drop the exclusive lock. +// have the shared lock, you may accidentally drop the exclusive lock. package flock import ( @@ -86,17 +86,17 @@ func (f *Flock) String() string { // conditions is met: TryLock succeeds, TryLock fails with error, or Context // Done channel is closed. func (f *Flock) TryLockContext(ctx context.Context, retryDelay time.Duration) (bool, error) { - return tryCtx(f.TryLock, ctx, retryDelay) + return tryCtx(ctx, f.TryLock, retryDelay) } // TryRLockContext repeatedly tries to take a shared lock until one of the // conditions is met: TryRLock succeeds, TryRLock fails with error, or Context // Done channel is closed. func (f *Flock) TryRLockContext(ctx context.Context, retryDelay time.Duration) (bool, error) { - return tryCtx(f.TryRLock, ctx, retryDelay) + return tryCtx(ctx, f.TryRLock, retryDelay) } -func tryCtx(fn func() (bool, error), ctx context.Context, retryDelay time.Duration) (bool, error) { +func tryCtx(ctx context.Context, fn func() (bool, error), retryDelay time.Duration) (bool, error) { if ctx.Err() != nil { return false, ctx.Err() }