Use dep as dependency management tool (#98)

* chore: exclude vendor folder.

* chore: add dep configuration.

* chore: update Travis config for dep.

* refactor: go fmt on files.
This commit is contained in:
Ludovic Fernandez
2017-11-15 11:40:39 +01:00
committed by Emile Vauge
parent 53ac43fda5
commit 178357dd68
8 changed files with 192 additions and 10 deletions
+2
View File
@@ -25,3 +25,5 @@ _testmain.go
.idea/
flymake_*
vendor/
+16 -5
View File
@@ -1,12 +1,23 @@
language: go
go:
- 1.5.4
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x
- master
sudo: false
before_install:
- curl -sI https://github.com/golang/dep/releases/latest | grep -Fi Location | tr -d '\r' | sed "s/tag/download/g" | awk -F " " '{ print $2 "/dep-linux-amd64"}' | wget --output-document=$GOPATH/bin/dep -i -
- chmod +x $GOPATH/bin/dep
install: make dependencies
script:
- go get -t ./...
- go test ./...
- go vet ./...
- go fmt ./...
- PKGS=$(go list ./... | grep -v '/vendor/')
- GOFILES=$(go list -f '{{range $index, $element := .GoFiles}}{{$.Dir}}/{{$element}}{{"\n"}}{{end}}' ./... | grep -v '/vendor/')
- go test -cover -race $PKGS
- go vet $PKGS
- diff -u <(echo -n) <(gofmt -d $GOFILES)
Generated
+111
View File
@@ -0,0 +1,111 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
name = "github.com/codahale/hdrhistogram"
packages = ["."]
revision = "3a0bb77429bd3a61596f5e8a3172445844342120"
[[projects]]
branch = "master"
name = "github.com/davecgh/go-spew"
packages = ["spew"]
revision = "ecdeabc65495df2dec95d7c4a4c3e021903035e5"
[[projects]]
name = "github.com/gravitational/trace"
packages = ["."]
revision = "77f42dab0785f2fa2923c08cba5c37dec0687572"
version = "1.1.2"
[[projects]]
branch = "master"
name = "github.com/jonboulle/clockwork"
packages = ["."]
revision = "bcac9884e7502bb2b474c0339d889cb981a2f27f"
[[projects]]
branch = "master"
name = "github.com/mailgun/minheap"
packages = ["."]
revision = "3dbe6c6bf55f94c5efcf460dc7f86830c21a90b2"
[[projects]]
branch = "master"
name = "github.com/mailgun/multibuf"
packages = ["."]
revision = "565402cd71fbd9c12aa7e295324ea357e970a61e"
[[projects]]
branch = "master"
name = "github.com/mailgun/timetools"
packages = ["."]
revision = "f3a7b8ffff474320c4f5cc564c9abb2c52ded8bc"
[[projects]]
branch = "master"
name = "github.com/mailgun/ttlmap"
packages = ["."]
revision = "c1c17f74874f2a5ea48bfb06b5459d4ef2689749"
[[projects]]
name = "github.com/pmezard/go-difflib"
packages = ["difflib"]
revision = "792786c7400a136282c1664665ae0a8db921c6c2"
version = "v1.0.0"
[[projects]]
name = "github.com/sirupsen/logrus"
packages = ["."]
revision = "f006c2ac4710855cf0f916dd6b77acf6b048dc6e"
version = "v1.0.3"
[[projects]]
name = "github.com/stretchr/testify"
packages = ["assert"]
revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0"
version = "v1.1.4"
[[projects]]
name = "github.com/vulcand/predicate"
packages = ["."]
revision = "939c094524d124c55fa8afe0e077701db4a865e2"
version = "v1.0.0"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = ["ssh/terminal"]
revision = "6a293f2d4b14b8e6d3f0539e383f6d0d30fce3fd"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = ["context","websocket"]
revision = "a337091b0525af65de94df2eb7e98bd9962dcbe2"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
packages = ["unix","windows"]
revision = "1e2299c37cc91a509f1b12369872d27be0ce98a6"
[[projects]]
branch = "v1"
name = "gopkg.in/check.v1"
packages = ["."]
revision = "20d25e2804050c1cd24a7eea1e7a6447dd0e74ec"
[[projects]]
branch = "v2"
name = "gopkg.in/mgo.v2"
packages = ["bson","internal/json"]
revision = "3f83fa5005286a7fe593b055f0d7771a7dce4655"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "3d39f8dd9f1e20d1d30660d88a08ea907cd2b9db15a1dfcde2f0ce35015c833e"
solver-name = "gps-cdcl"
solver-version = 1
+51
View File
@@ -0,0 +1,51 @@
[[constraint]]
branch = "master"
name = "github.com/codahale/hdrhistogram"
[[constraint]]
branch = "master"
name = "github.com/mailgun/multibuf"
[[constraint]]
branch = "master"
name = "github.com/mailgun/timetools"
[[constraint]]
branch = "master"
name = "github.com/mailgun/ttlmap"
[[constraint]]
name = "github.com/sirupsen/logrus"
version = "1.0.3"
[[constraint]]
name = "github.com/stretchr/testify"
version = "1.1.4"
[[constraint]]
name = "github.com/vulcand/predicate"
version = "1.0.0"
[[constraint]]
branch = "master"
name = "golang.org/x/net"
[[constraint]]
branch = "v1"
name = "gopkg.in/check.v1"
[[override]]
branch = "master"
name = "github.com/jonboulle/clockwork"
[[override]]
branch = "master"
name = "github.com/pmezard/go-difflib"
[[override]]
branch = "master"
name = "github.com/davecgh/go-spew"
[[override]]
branch = "master"
name = "github.com/gravitational/trace"
+9 -2
View File
@@ -1,5 +1,12 @@
.PHONY: all
PKGS := $(shell go list ./... | grep -v '/vendor/')
test: clean
go test -v ./... -cover
go test -v -race -cover $(PKGS)
dependencies:
dep ensure -v
clean:
find . -name flymake_* -delete
@@ -15,4 +22,4 @@ cover-package: clean
go tool cover -html=/tmp/coverage.out
sloccount:
find . -path ./Godeps -prune -o -name "*.go" -print0 | xargs -0 wc -l
find . -path ./vendor -prune -o -name "*.go" -print0 | xargs -0 wc -l
+1 -1
View File
@@ -4,8 +4,8 @@ import (
"fmt"
"time"
log "github.com/sirupsen/logrus"
"github.com/mailgun/timetools"
log "github.com/sirupsen/logrus"
)
// ratioController allows passing portions traffic back to the endpoints,
+1 -1
View File
@@ -7,9 +7,9 @@ import (
"sync"
"time"
log "github.com/sirupsen/logrus"
"github.com/mailgun/timetools"
"github.com/mailgun/ttlmap"
log "github.com/sirupsen/logrus"
"github.com/vulcand/oxy/utils"
)
+1 -1
View File
@@ -7,8 +7,8 @@ import (
"sync"
"time"
log "github.com/sirupsen/logrus"
"github.com/mailgun/timetools"
log "github.com/sirupsen/logrus"
"github.com/vulcand/oxy/memmetrics"
"github.com/vulcand/oxy/utils"
)