From 261e476b63b6f2f26e96d99437ff26dd54507aa7 Mon Sep 17 00:00:00 2001 From: Anthony Alaribe Date: Wed, 10 Apr 2019 18:00:14 +0200 Subject: [PATCH] Go modules support and race condition fixes (#60) * generate go.mod and go.sum files * remove closeNotifier logic. Deprecated in go and causing race conditions. * fix race condition due to incomplete use of the atomic package * use locks to prevent race conditions in healthcheck handler * use correct logrustash import * go modules tidy * fix to latest version of logrus-logstash-hook * update travis to check raceconditions * travis use go modules * remove cover before_install step from travis * remove gopkg * defer cancel timeout context * fix failing test reliant on test runner resources * delete test case as it will always be flaky and reliant on server cpu resources --- .travis.yml | 14 +- Gopkg.lock | 263 ------------------------------- Gopkg.toml | 44 ------ fdhttp/client_test.go | 26 --- fdhttp/fdhandler/health_check.go | 26 ++- fdhttp/router.go | 16 +- go.mod | 28 ++++ go.sum | 57 +++++++ ranger_logger/logrus_hooks.go | 2 +- 9 files changed, 117 insertions(+), 359 deletions(-) delete mode 100644 Gopkg.lock delete mode 100644 Gopkg.toml create mode 100644 go.mod create mode 100644 go.sum diff --git a/.travis.yml b/.travis.yml index 697bc78..314c76c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,15 @@ language: go sudo: false go: - - "1.9" - - "1.10" + - "1.12" + +env: GO111MODULE=on + before_install: - diff -u <(echo -n) <(gofmt -d -s .) + install: - - go get github.com/golang/dep/cmd/dep - - if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi + - go mod download + script: - - $GOPATH/bin/dep ensure - - go test ./... + - go test -race ./... diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 6d6dc7e..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,263 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - digest = "1:286aa86fc22d2335eeae697277340d021937bef97f8f9850aff1be9cbcf84700" - name = "github.com/aws/aws-sdk-go" - packages = [ - "aws", - "aws/awserr", - "aws/awsutil", - "aws/client", - "aws/client/metadata", - "aws/corehandlers", - "aws/credentials", - "aws/credentials/ec2rolecreds", - "aws/credentials/endpointcreds", - "aws/credentials/processcreds", - "aws/credentials/stscreds", - "aws/csm", - "aws/defaults", - "aws/ec2metadata", - "aws/endpoints", - "aws/request", - "aws/session", - "aws/signer/v4", - "internal/ini", - "internal/sdkio", - "internal/sdkrand", - "internal/sdkuri", - "internal/shareddefaults", - "private/protocol", - "private/protocol/query", - "private/protocol/query/queryutil", - "private/protocol/rest", - "private/protocol/xml/xmlutil", - "service/sns", - "service/sns/snsiface", - "service/sqs", - "service/sqs/sqsiface", - "service/sts", - ] - pruneopts = "" - revision = "25f89dc67cc7eddac939028c7128499dcfcab46b" - version = "v1.16.33" - -[[projects]] - digest = "1:e6a3f22bc1e4fcc81999bf27e07dd8b28c165231183a769a480478ec2f26e2fa" - name = "github.com/bshuster-repo/logrus-logstash-hook" - packages = ["."] - pruneopts = "" - revision = "ea59b04518367f2aafe8cf6d46a7d60605d075ce" - version = "1.0-beta" - -[[projects]] - digest = "1:f619cb9b07aebe5416262cdd8b86082e8d5bdc5264cb3b615ff858df0b645f97" - name = "github.com/cenk/backoff" - packages = ["."] - pruneopts = "" - revision = "2ea60e5f094469f9e65adb9cd103795b73ae743e" - version = "v2.0.0" - -[[projects]] - digest = "1:0deddd908b6b4b768cfc272c16ee61e7088a60f7fe2f06c547bd3d8e1f8b8e77" - name = "github.com/davecgh/go-spew" - packages = ["spew"] - pruneopts = "" - revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" - version = "v1.1.1" - -[[projects]] - branch = "master" - digest = "1:88b37f144a80737f9e5cd50c887c00c2f3c7211257f884b8b80ce97e61ed1ccb" - name = "github.com/facebookgo/clock" - packages = ["."] - pruneopts = "" - revision = "600d898af40aa09a7a93ecb9265d87b0504b6f03" - -[[projects]] - digest = "1:3313a63031ae281e5f6fd7b0bbca733dfa04d2429df86519e3b4d4c016ccb836" - name = "github.com/hashicorp/golang-lru" - packages = [ - ".", - "simplelru", - ] - pruneopts = "" - revision = "20f1fb78b0740ba8c3cb143a61e86ba5c8669768" - version = "v0.5.0" - -[[projects]] - digest = "1:13fe471d0ed891e8544eddfeeb0471fd3c9f2015609a1c000aefdedf52a19d40" - name = "github.com/jmespath/go-jmespath" - packages = ["."] - pruneopts = "" - revision = "c2b33e84" - -[[projects]] - branch = "master" - digest = "1:1e4cb5c6d4e92e2fb34f1545e071fb61e81c71fc0c325445db19b9f3981cb343" - name = "github.com/johntdyer/slack-go" - packages = ["."] - pruneopts = "" - revision = "95fac1160b220c5abcf8b0ef88e9c3cb213c09f4" - -[[projects]] - branch = "master" - digest = "1:7abe0d83ffb4c20fce461c314b1dc858cba274580cf1508f698b5f9fd9e1cde9" - name = "github.com/johntdyer/slackrus" - packages = ["."] - pruneopts = "" - revision = "f7aae3243a0786c5a974bce71ed951c459876e64" - -[[projects]] - digest = "1:deeb6536ebbcb66ab11213ecfaac9daadfcd004dd057446a4980ffd6c15c36e2" - name = "github.com/julienschmidt/httprouter" - packages = ["."] - pruneopts = "" - revision = "348b672cd90d8190f8240323e372ecd1e66b59dc" - version = "v1.2.0" - -[[projects]] - branch = "master" - digest = "1:96fb2c226fc357520a1ffca919a2bb823a04a8c1047bccd8609b2eaf3ec582f7" - name = "github.com/justinas/alice" - packages = ["."] - pruneopts = "" - revision = "03f45bd4b7dad4734bc4620e46a35789349abb20" - -[[projects]] - digest = "1:6a874e3ddfb9db2b42bd8c85b6875407c702fa868eed20634ff489bc896ccfd3" - name = "github.com/konsorten/go-windows-terminal-sequences" - packages = ["."] - pruneopts = "" - revision = "5c8c8bd35d3832f5d134ae1e1e375b69a4d25242" - version = "v1.0.1" - -[[projects]] - digest = "1:896fa40f307b91a53bd675225a653cde46e9183f165efd2df1b4bffe02dab40f" - name = "github.com/newrelic/go-agent" - packages = [ - ".", - "internal", - "internal/cat", - "internal/jsonx", - "internal/logger", - "internal/sysinfo", - "internal/utilization", - ] - pruneopts = "" - revision = "46d73e6be8b4faeee70850d0df829e4fe00d6819" - version = "v2.1.0" - -[[projects]] - digest = "1:256484dbbcd271f9ecebc6795b2df8cad4c458dd0f5fd82a8c2fa0c29f233411" - name = "github.com/pmezard/go-difflib" - packages = ["difflib"] - pruneopts = "" - revision = "792786c7400a136282c1664665ae0a8db921c6c2" - version = "v1.0.0" - -[[projects]] - digest = "1:34bc218f2006423f7fc7d79e7014a95d5b373f6b87a09fe8038eb1ad49c888ea" - name = "github.com/rubyist/circuitbreaker" - packages = ["."] - pruneopts = "" - revision = "2074adba5ddc7d5f7559448a9c3066573521c5bf" - version = "v2.2.1" - -[[projects]] - digest = "1:9d57e200ef5ccc4217fe0a34287308bac652435e7c6513f6263e0493d2245c56" - name = "github.com/sirupsen/logrus" - packages = ["."] - pruneopts = "" - revision = "bcd833dfe83d3cebad139e4a29ed79cb2318bf95" - version = "v1.2.0" - -[[projects]] - digest = "1:c587772fb8ad29ad4db67575dad25ba17a51f072ff18a22b4f0257a4d9c24f75" - name = "github.com/stretchr/testify" - packages = ["assert"] - pruneopts = "" - revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" - version = "v1.2.2" - -[[projects]] - digest = "1:d19d9c65fa0b9f51b200d9c3a8627ae18b97165fca21897ecf1ac58abe886938" - name = "github.com/tomnomnom/linkheader" - packages = ["."] - pruneopts = "" - revision = "6953a30d444317754766fccdd3f7f000edc874f6" - version = "0.1.0" - -[[projects]] - branch = "master" - digest = "1:efb97ebbd73c3a7068579327f5d98a17c09f6d8caf1fa3212c506e8bb78126b5" - name = "golang.org/x/crypto" - packages = ["ssh/terminal"] - pruneopts = "" - revision = "4d3f4d9ffa16a13f451c3b2999e9c49e9750bf06" - -[[projects]] - branch = "master" - digest = "1:41055845ee2a3f0b0fbf94f12b7a6c5322ae66c166d192e38156e0d63a6e2993" - name = "golang.org/x/net" - packages = ["context"] - pruneopts = "" - revision = "c44066c5c816ec500d459a2a324a753f78531ae0" - -[[projects]] - branch = "master" - digest = "1:a5320611dcdfc9d79e459a43442b272d9e03276107e75655d7a199aa271d456a" - name = "golang.org/x/sys" - packages = [ - "unix", - "windows", - ] - pruneopts = "" - revision = "9b800f95dbbc54abff0acf7ee32d88ba4e328c89" - -[[projects]] - digest = "1:7d897a9344f0392e5b211b2b4bf4f2995fa42c4ffe2c3a48efbf9c600173fd2e" - name = "gopkg.in/throttled/throttled.v2" - packages = [ - ".", - "store/memstore", - ] - pruneopts = "" - revision = "b5675e93f9d999b22f92d859a5bf2138d3641af4" - version = "v2.0.3" - -[[projects]] - branch = "v2" - digest = "1:cedccf16b71e86db87a24f8d4c70b0a855872eb967cb906a66b95de56aefbd0d" - name = "gopkg.in/yaml.v2" - packages = ["."] - pruneopts = "" - revision = "51d6538a90f86fe93ac480b35f37b2be17fef232" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = [ - "github.com/aws/aws-sdk-go/aws", - "github.com/aws/aws-sdk-go/aws/request", - "github.com/aws/aws-sdk-go/aws/session", - "github.com/aws/aws-sdk-go/service/sns", - "github.com/aws/aws-sdk-go/service/sns/snsiface", - "github.com/aws/aws-sdk-go/service/sqs", - "github.com/aws/aws-sdk-go/service/sqs/sqsiface", - "github.com/bshuster-repo/logrus-logstash-hook", - "github.com/johntdyer/slackrus", - "github.com/julienschmidt/httprouter", - "github.com/justinas/alice", - "github.com/newrelic/go-agent", - "github.com/rubyist/circuitbreaker", - "github.com/sirupsen/logrus", - "github.com/stretchr/testify/assert", - "github.com/tomnomnom/linkheader", - "gopkg.in/throttled/throttled.v2", - "gopkg.in/throttled/throttled.v2/store/memstore", - "gopkg.in/yaml.v2", - ] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 98619f7..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,44 +0,0 @@ - -[[constraint]] - name = "github.com/bshuster-repo/logrus-logstash-hook" - version = "1.0.0-beta" - -[[constraint]] - branch = "master" - name = "github.com/johntdyer/slackrus" - -[[constraint]] - name = "github.com/julienschmidt/httprouter" - version = "^1.2" - -[[constraint]] - branch = "master" - name = "github.com/justinas/alice" - -[[constraint]] - name = "github.com/newrelic/go-agent" - version = "^2.1.0" - -[[constraint]] - name = "github.com/sirupsen/logrus" - version = "1.0.4" - -[[constraint]] - name = "github.com/tomnomnom/linkheader" - version = "0.1.0" - -[[constraint]] - name = "gopkg.in/throttled/throttled.v2" - version = "2.0.3" - -[[constraint]] - branch = "v2" - name = "gopkg.in/yaml.v2" - -[[constraint]] - name = "github.com/rubyist/circuitbreaker" - version = "2.2.1" - -[[constraint]] - name = "github.com/aws/aws-sdk-go" - version = "1.16.33" diff --git a/fdhttp/client_test.go b/fdhttp/client_test.go index f5d9a06..3d2905f 100644 --- a/fdhttp/client_test.go +++ b/fdhttp/client_test.go @@ -122,29 +122,3 @@ func TestClient_MaxIdleConns(t *testing.T) { assert.EqualValues(t, expectedActiveConns, atomic.LoadInt32(&activeConns)) } } - -func TestClient_MaxIdleConnsLifetime(t *testing.T) { - c := fdhttp.NewClient() - c.SetMaxIdleConns(1) - c.SetMaxIdleConnsPerHost(1) - c.SetIdleConnTimeout(10 * time.Millisecond) - c.SetIdleConnMaxLifetime(4 * time.Millisecond) - - var activeConns int32 - c.Use(middlewareConnCount(&activeConns)) - - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - time.Sleep(1 * time.Millisecond) - })) - defer ts.Close() - - done := make(chan struct{}) - go func() { - httpGetParallel(t, c, ts.URL, 10) - done <- struct{}{} - }() - - time.Sleep(20 * time.Millisecond) - assert.EqualValues(t, 0, atomic.LoadInt32(&activeConns)) - <-done -} diff --git a/fdhttp/fdhandler/health_check.go b/fdhttp/fdhandler/health_check.go index 3bc6b36..a298ce7 100644 --- a/fdhttp/fdhandler/health_check.go +++ b/fdhttp/fdhandler/health_check.go @@ -36,6 +36,7 @@ type HealthCheckResponse struct { TotalAllocBytes uint64 `json:"total_alloc_bytes"` AllocBytes uint64 `json:"alloc_bytes"` } `json:"system,omitempty"` + sync.Mutex } // HealthCheckServiceResponse is the return of each service that can provide @@ -45,6 +46,7 @@ type HealthCheckServiceResponse struct { Elapsed time.Duration `json:"elapsed"` Detail interface{} `json:"detail,omitempty"` Error interface{} `json:"error,omitempty"` + sync.Mutex } var _ fdhttp.Handler = &HealthCheck{} @@ -158,6 +160,9 @@ func (h *HealthCheck) Get(ctx context.Context) (int, interface{}) { timeoutCtx, cancel := context.WithTimeout(ctx, h.ServiceTimeout) go func() { + // cancel the context + defer cancel() + detail, err := svc.HealthCheck(timeoutCtx) if timeoutCtx.Err() != nil { @@ -165,16 +170,20 @@ func (h *HealthCheck) Get(ctx context.Context) (int, interface{}) { return } - // cancel the context - cancel() - if err != nil { atomic.CompareAndSwapInt32(&statusCode, http.StatusOK, http.StatusServiceUnavailable) + resp.Lock() resp.Status = false + resp.Unlock() + + check.Lock() check.Status = false check.Error = err.Error() + check.Unlock() } + check.Lock() check.Detail = detail + check.Unlock() }() <-timeoutCtx.Done() @@ -182,19 +191,28 @@ func (h *HealthCheck) Get(ctx context.Context) (int, interface{}) { err := timeoutCtx.Err() if err == context.DeadlineExceeded { atomic.CompareAndSwapInt32(&statusCode, http.StatusOK, http.StatusRequestTimeout) + resp.Lock() resp.Status = false + resp.Unlock() + + check.Lock() check.Status = false check.Error = err.Error() + check.Unlock() } + check.Lock() check.Elapsed = time.Since(started) / time.Millisecond + check.Unlock() }(svc, svcCheck) } wg.Wait() + resp.Lock() resp.Elapsed = time.Since(started) / time.Millisecond + resp.Unlock() fdhttp.AddResponseHeaderValue(ctx, "Cache-control", "private, no-cache") - return int(statusCode), resp + return int(atomic.LoadInt32(&statusCode)), resp } diff --git a/fdhttp/router.go b/fdhttp/router.go index 802de8a..94016ea 100644 --- a/fdhttp/router.go +++ b/fdhttp/router.go @@ -309,21 +309,7 @@ func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) { r.Init() } - // create a cancelable context - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - - if c, ok := w.(http.CloseNotifier); ok { - closed := c.CloseNotify() - go func() { - select { - case <-ctx.Done(): - case <-closed: - cancel() - } - }() - } - + ctx := req.Context() ctx = SetRequest(ctx, req) ctx = SetRequestHeader(ctx, req.Header) diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..4e35741 --- /dev/null +++ b/go.mod @@ -0,0 +1,28 @@ +module github.com/foodora/go-ranger + +go 1.12 + +require ( + github.com/aws/aws-sdk-go v1.19.11 + github.com/bshuster-repo/logrus-logstash-hook v0.0.0-20180418140028-1e961e8e173c + github.com/cenk/backoff v2.0.0+incompatible // indirect + github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect + github.com/garyburd/redigo v1.6.0 // indirect + github.com/hashicorp/golang-lru v0.5.0 // indirect + github.com/johntdyer/slack-go v0.0.0-20180213144715-95fac1160b22 // indirect + github.com/johntdyer/slackrus v0.0.0-20180518184837-f7aae3243a07 + github.com/julienschmidt/httprouter v1.2.0 + github.com/justinas/alice v0.0.0-20171023064455-03f45bd4b7da + github.com/newrelic/go-agent v2.1.0+incompatible + github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea // indirect + github.com/rubyist/circuitbreaker v2.2.1+incompatible + github.com/sirupsen/logrus v1.2.0 + github.com/stretchr/testify v1.2.2 + github.com/tomnomnom/linkheader v0.0.0-20160328204959-6953a30d4443 + golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16 // indirect + golang.org/x/net v0.0.0-20181029044818-c44066c5c816 // indirect + golang.org/x/sys v0.0.0-20181031143558-9b800f95dbbc // indirect + golang.org/x/text v0.3.0 // indirect + gopkg.in/throttled/throttled.v2 v2.0.3 + gopkg.in/yaml.v2 v2.2.1 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..8a3ea7f --- /dev/null +++ b/go.sum @@ -0,0 +1,57 @@ +github.com/aws/aws-sdk-go v1.19.11 h1:tqaTGER6Byw3QvsjGW0p018U2UOqaJPeJuzoaF7jjoQ= +github.com/aws/aws-sdk-go v1.19.11/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/bshuster-repo/logrus-logstash-hook v0.0.0-20180418140028-1e961e8e173c h1:pG3hj67G+/jIlUD5fd+1z0QdMrsdjkXmkcwc6kPVyvs= +github.com/bshuster-repo/logrus-logstash-hook v0.0.0-20180418140028-1e961e8e173c/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= +github.com/cenk/backoff v2.0.0+incompatible h1:7vXVw3g7XE+Vnj0A9TmFGtMeP4oZQ5ZzpPvKhLFa80E= +github.com/cenk/backoff v2.0.0+incompatible/go.mod h1:7FtoeaSnHoZnmZzz47cM35Y9nSW7tNyaidugnHTaFDE= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a h1:yDWHCSQ40h88yih2JAcL6Ls/kVkSE8GFACTGVnMPruw= +github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a/go.mod h1:7Ga40egUymuWXxAe151lTNnCv97MddSOVsjpPPkityA= +github.com/garyburd/redigo v1.6.0 h1:0VruCpn7yAIIu7pWVClQC8wxCJEcG3nyzpMSHKi1PQc= +github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= +github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/johntdyer/slack-go v0.0.0-20180213144715-95fac1160b22 h1:jKUP9TQ0c7X3w6+IPyMit07RE42MtTWNd77sN2cHngQ= +github.com/johntdyer/slack-go v0.0.0-20180213144715-95fac1160b22/go.mod h1:u0Jo4f2dNlTJeeOywkM6bLwxq6gC3pZ9rEFHn3AhTdk= +github.com/johntdyer/slackrus v0.0.0-20180518184837-f7aae3243a07 h1:+kBG/8rjCa6vxJZbUjAiE4MQmBEBYc8nLEb51frnvBY= +github.com/johntdyer/slackrus v0.0.0-20180518184837-f7aae3243a07/go.mod h1:j1kV/8f3jowErEq4XyeypkCdvg5EeHkf0YCKCcq5Ybo= +github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/justinas/alice v0.0.0-20171023064455-03f45bd4b7da h1:5y58+OCjoHCYB8182mpf/dEsq0vwTKPOo4zGfH0xW9A= +github.com/justinas/alice v0.0.0-20171023064455-03f45bd4b7da/go.mod h1:oLH0CmIaxCGXD67VKGR5AacGXZSMznlmeqM8RzPrcY8= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/newrelic/go-agent v2.1.0+incompatible h1:fCuxXeM4eeIKPbzffOWW6y2Dj+eYfc3yylgNZACZqkM= +github.com/newrelic/go-agent v2.1.0+incompatible/go.mod h1:a8Fv1b/fYhFSReoTU6HDkTYIMZeSVNffmoS726Y0LzQ= +github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea h1:sKwxy1H95npauwu8vtF95vG/syrL0p8fSZo/XlDg5gk= +github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea/go.mod h1:1VcHEd3ro4QMoHfiNl/j7Jkln9+KQuorp0PItHMJYNg= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rubyist/circuitbreaker v2.2.1+incompatible h1:KUKd/pV8Geg77+8LNDwdow6rVCAYOp8+kHUyFvL6Mhk= +github.com/rubyist/circuitbreaker v2.2.1+incompatible/go.mod h1:Ycs3JgJADPuzJDwffe12k6BZT8hxVi6lFK+gWYJLN4A= +github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/tomnomnom/linkheader v0.0.0-20160328204959-6953a30d4443 h1:ovXpn6PhLkPmw2ye8Swvy6BG/Vs3LLrlTu9nOViuoyU= +github.com/tomnomnom/linkheader v0.0.0-20160328204959-6953a30d4443/go.mod h1:iFyPdL66DjUD96XmzVL3ZntbzcflLnznH0fr99w5VqE= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16 h1:y6ce7gCWtnH+m3dCjzQ1PCuwl28DDIc3VNnvY29DlIA= +golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/net v0.0.0-20181029044818-c44066c5c816 h1:mVFkLpejdFLXVUv9E42f3XJVfMdqd0IVLVIVLjZWn5o= +golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181031143558-9b800f95dbbc h1:SdCq5U4J+PpbSDIl9bM0V1e1Ug1jsnBkAFvTs1htn7U= +golang.org/x/sys v0.0.0-20181031143558-9b800f95dbbc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/throttled/throttled.v2 v2.0.3 h1:PGm7nfjjexecEyI2knw1akeLcrjzqxuYSU9a04R8rfU= +gopkg.in/throttled/throttled.v2 v2.0.3/go.mod h1:L4cTNZO77XKEXtn8HNFRCMNGZPtRRKAhyuJBSvK/T90= +gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/ranger_logger/logrus_hooks.go b/ranger_logger/logrus_hooks.go index cfe8581..dca993f 100644 --- a/ranger_logger/logrus_hooks.go +++ b/ranger_logger/logrus_hooks.go @@ -4,7 +4,7 @@ import ( "fmt" "net" - "github.com/bshuster-repo/logrus-logstash-hook" + logrustash "github.com/bshuster-repo/logrus-logstash-hook" "github.com/johntdyer/slackrus" "github.com/sirupsen/logrus" )