From 8a62af5a73e7b3137f0f91a9dafe8d08ce6eca4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ken-H=C3=A5vard=20Lieng?= Date: Mon, 3 Jul 2017 07:39:10 +0200 Subject: [PATCH] Unvendor resync --- vendor/github.com/matryer/resync/LICENSE | 21 ------------ vendor/github.com/matryer/resync/README.md | 29 ----------------- vendor/github.com/matryer/resync/once.go | 38 ---------------------- vendor/vendor.json | 6 ---- 4 files changed, 94 deletions(-) delete mode 100644 vendor/github.com/matryer/resync/LICENSE delete mode 100644 vendor/github.com/matryer/resync/README.md delete mode 100644 vendor/github.com/matryer/resync/once.go diff --git a/vendor/github.com/matryer/resync/LICENSE b/vendor/github.com/matryer/resync/LICENSE deleted file mode 100644 index e516db8f..00000000 --- a/vendor/github.com/matryer/resync/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Mat Ryer - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/matryer/resync/README.md b/vendor/github.com/matryer/resync/README.md deleted file mode 100644 index 9a1a83a5..00000000 --- a/vendor/github.com/matryer/resync/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# resync - -`sync.Once` with `Reset()` - - * See [sync.Once](http://golang.org/pkg/sync/#Once) - -Rather than adding this project as a dependency, consider [dropping](https://github.com/matryer/drop) this file into your project. - -## Example - -The following example examines how `resync.Once` could be used in a HTTP server situation. - -```go -// use it just like sync.Once -var once resync.Once - -// handle a web request -func handleRequest(w http.ResponseWriter, r *http.Request) { - once.Do(func(){ - // load templates or something - }) - // TODO: respond -} - -// handle some request that indicates things have changed -func handleResetRequest(w http.ResponseWriter, r *http.Request) { - once.Reset() // call Reset to cause initialisation to happen again above -} -``` diff --git a/vendor/github.com/matryer/resync/once.go b/vendor/github.com/matryer/resync/once.go deleted file mode 100644 index 54c7bf2a..00000000 --- a/vendor/github.com/matryer/resync/once.go +++ /dev/null @@ -1,38 +0,0 @@ -package resync - -import ( - "sync" - "sync/atomic" -) - -// Once is an object that will perform exactly one action -// until Reset is called. -// See http://golang.org/pkg/sync/#Once -type Once struct { - m sync.Mutex - done uint32 -} - -// Do simulates sync.Once.Do by executing the specified function -// only once, until Reset is called. -// See http://golang.org/pkg/sync/#Once -func (o *Once) Do(f func()) { - if atomic.LoadUint32(&o.done) == 1 { - return - } - // Slow-path. - o.m.Lock() - defer o.m.Unlock() - if o.done == 0 { - defer atomic.StoreUint32(&o.done, 1) - f() - } -} - -// Reset indicates that the next call to Do should actually be called -// once again. -func (o *Once) Reset() { - o.m.Lock() - defer o.m.Unlock() - atomic.StoreUint32(&o.done, 0) -} diff --git a/vendor/vendor.json b/vendor/vendor.json index 1defd89c..3a9d5170 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -332,12 +332,6 @@ "revision": "51463bfca2576e06c62a8504b5c0f06d61312647", "revisionTime": "2017-03-21T09:30:39Z" }, - { - "checksumSHA1": "C4o27pZpCxioJpXbAL7NFYS9mrI=", - "path": "github.com/matryer/resync", - "revision": "d39c09a11215c84aab0b65e323fc47dd6e276af1", - "revisionTime": "2016-12-11T20:24:28Z" - }, { "checksumSHA1": "V8CycX4FOqp+fAMzZeQY6TKv4AU=", "path": "github.com/miekg/dns",