From 38c9e4619f0d5d8ff3fb574fc6260901f2495776 Mon Sep 17 00:00:00 2001 From: Matt Silverlock Date: Tue, 25 Jun 2019 18:18:22 -0700 Subject: [PATCH] Remove gorilla/context as part of pre-1.7 support (#114) --- .travis.yml | 28 ---------------------------- context_legacy.go | 28 ---------------------------- go.mod | 1 - go.sum | 4 ++++ 4 files changed, 4 insertions(+), 57 deletions(-) delete mode 100644 .travis.yml delete mode 100644 context_legacy.go create mode 100644 go.sum diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5c814da..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: go -sudo: false - -matrix: - include: - - go: "1.x" - env: "LATEST=true" - - go: "1.3.x" - - go: "1.4.x" - - go: "1.5.x" - - go: "1.6.x" - - go: "1.7.x" - - go: "1.8.x" - - go: "1.9.x" - - go: "1.10.x" - - go: tip - allow_failures: - - go: tip - -install: - - # skip - -script: - - go get -t -v ./... - - diff -u <(echo -n) <(gofmt -d .) - - if [ "${LATEST}" = "true" ]; then go vet ./...; fi - - go test -v -race ./... - diff --git a/context_legacy.go b/context_legacy.go deleted file mode 100644 index f88c9eb..0000000 --- a/context_legacy.go +++ /dev/null @@ -1,28 +0,0 @@ -// +build !go1.7 - -package csrf - -import ( - "net/http" - - "github.com/gorilla/context" - - "github.com/pkg/errors" -) - -func contextGet(r *http.Request, key string) (interface{}, error) { - if val, ok := context.GetOk(r, key); ok { - return val, nil - } - - return nil, errors.Errorf("no value exists in the context for key %q", key) -} - -func contextSave(r *http.Request, key string, val interface{}) *http.Request { - context.Set(r, key, val) - return r -} - -func contextClear(r *http.Request) { - context.Clear(r) -} diff --git a/go.mod b/go.mod index 2d2ce4d..a5bf9b2 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,6 @@ module github.com/gorilla/csrf require ( - github.com/gorilla/context v1.1.1 github.com/gorilla/securecookie v1.1.1 github.com/pkg/errors v0.8.0 ) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..2d11d99 --- /dev/null +++ b/go.sum @@ -0,0 +1,4 @@ +github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= +github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= +github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=