From c67241b5fa2bf7553f078b4ccae2fd0033e57358 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 6 Oct 2019 02:39:43 +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: 61a2b7ac94bdd7be69e71af08e26bc2a8bd7e675 Component: engine --- components/engine/vendor.conf | 2 +- .../engine/vendor/github.com/gofrs/flock/README.md | 1 + .../engine/vendor/github.com/gofrs/flock/flock.go | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/components/engine/vendor.conf b/components/engine/vendor.conf index 43229affaf2..af52308e7c4 100644 --- a/components/engine/vendor.conf +++ b/components/engine/vendor.conf @@ -33,7 +33,7 @@ github.com/opentracing/opentracing-go 1361b9cd60be79c4c3a7fa9841b3 github.com/google/shlex 6f45313302b9c56850fc17f99e40caebce98c716 github.com/opentracing-contrib/go-stdlib b1a47cfbdd7543e70e9ef3e73d0802ad306cc1cc github.com/mitchellh/hashstructure 2bca23e0e452137f789efbc8610126fd8b94f73b -github.com/gofrs/flock 7f43ea2e6a643ad441fc12d0ecc0d3388b300c53 # v0.7.0 +github.com/gofrs/flock 392e7fae8f1b0bdbd67dad7237d23f618feb6dbb # v0.7.1 # libnetwork diff --git a/components/engine/vendor/github.com/gofrs/flock/README.md b/components/engine/vendor/github.com/gofrs/flock/README.md index 42d580f71be..7375e72eeb4 100644 --- a/components/engine/vendor/github.com/gofrs/flock/README.md +++ b/components/engine/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/engine/vendor/github.com/gofrs/flock/flock.go b/components/engine/vendor/github.com/gofrs/flock/flock.go index 5783a49855d..8f109b8a967 100644 --- a/components/engine/vendor/github.com/gofrs/flock/flock.go +++ b/components/engine/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() }