Skip to content

Commit

Permalink
all: stop vendoring external dependencies
Browse files Browse the repository at this point in the history
It's not good practice for a library, but we vendored our dependencies
in the past because go get github.com/fsouza/go-dockerclient was too
slow, but now vendoring is well advised in Go 1.5 and standard in Go
1.6. I'm also dropping Go 1.4 as some standard tools developed by the Go
core team already did that.

This will make tests on Travis run even faster, but I can hope that
golang/go#13078 will eventually get fixed.
  • Loading branch information
fsouza committed May 1, 2016
1 parent 1d4f4ae commit 9d5fef7
Show file tree
Hide file tree
Showing 363 changed files with 37 additions and 121,889 deletions.
20 changes: 12 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
language: go
sudo: required
go:
- 1.4.3
- 1.5.4
- 1.6.2
- tip
os:
- linux
- osx
env:
- GOARCH=amd64 DOCKER_VERSION=1.9.1
- GOARCH=386 DOCKER_VERSION=1.9.1
- GOARCH=amd64 DOCKER_VERSION=1.10.3
- GOARCH=386 DOCKER_VERSION=1.10.3
- GOARCH=amd64 DOCKER_VERSION=1.11.1
- GOARCH=386 DOCKER_VERSION=1.11.1
matrix:
- GOARCH=amd64 DOCKER_VERSION=1.9.1
- GOARCH=386 DOCKER_VERSION=1.9.1
- GOARCH=amd64 DOCKER_VERSION=1.10.3
- GOARCH=386 DOCKER_VERSION=1.10.3
- GOARCH=amd64 DOCKER_VERSION=1.11.1
- GOARCH=386 DOCKER_VERSION=1.11.1
global:
- GO_TEST_FLAGS=-race
- DOCKER_HOST=tcp://127.0.0.1:2375
install:
- travis_retry travis-scripts/install.bash
- make testdeps
- travis_retry travis-scripts/install-docker.bash
script:
- travis-scripts/run-tests.bash
services:
Expand Down
21 changes: 8 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.PHONY: \
all \
vendor \
lint \
vet \
fmt \
Expand All @@ -11,37 +10,33 @@
cov \
clean

PKGS = . ./testing

all: test

vendor:
@ go get -v github.com/mjibson/party
party -d external -c -u

lint:
@ go get -v github.com/golang/lint/golint
@for file in $$(git ls-files '*.go' | grep -v 'external/'); do \
@for file in $$(git ls-files '*.go'); do \
export output="$$(golint $${file} | grep -v 'type name will be used as docker.DockerInfo')"; \
[ -n "$${output}" ] && echo "$${output}" && export status=1; \
done; \
exit $${status:-0}

vet:
go vet $(PKGS)
go vet ./...

fmt:
gofmt -s -w $(PKGS)
gofmt -s -w .

fmtcheck:
@ export output=$$(gofmt -s -d $(PKGS)); \
@ export output=$$(gofmt -s -d .); \
[ -n "$${output}" ] && echo "$${output}" && export status=1; \
exit $${status:-0}
testdeps:
go get -d -t ./...

pretest: lint vet fmtcheck
pretest: testdeps lint vet fmtcheck

gotest:
go test $(GO_TEST_FLAGS) $(PKGS)
go test $(GO_TEST_FLAGS) ./...

test: pretest gotest

Expand Down
2 changes: 1 addition & 1 deletion build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"reflect"
"testing"

"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/archive"
)

func TestBuildImageMultipleContextsError(t *testing.T) {
Expand Down
16 changes: 7 additions & 9 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import (
"sync/atomic"
"time"

"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts"
"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/homedir"
"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/stdcopy"
"github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp"
"github.com/docker/docker/opts"
"github.com/docker/docker/pkg/homedir"
"github.com/docker/docker/pkg/stdcopy"
"github.com/hashicorp/go-cleanhttp"
)

const userAgent = "go-dockerclient"
Expand Down Expand Up @@ -798,12 +798,10 @@ func (c *Client) unixClient() *http.Client {
return c.unixHTTPClient
}
socketPath := c.endpointURL.Path
tr := &http.Transport{
Dial: func(network, addr string) (net.Conn, error) {
return c.Dialer.Dial("unix", socketPath)
},
tr := cleanhttp.DefaultTransport()
tr.Dial = func(network, addr string) (net.Conn, error) {
return c.Dialer.Dial("unix", socketPath)
}
cleanhttp.SetTransportFinalizer(tr)
c.unixHTTPClient = &http.Client{Transport: tr}
return c.unixHTTPClient
}
Expand Down
2 changes: 1 addition & 1 deletion client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"
"time"

"github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp"
"github.com/hashicorp/go-cleanhttp"
)

func TestNewAPIClient(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion container.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"strings"
"time"

"github.com/fsouza/go-dockerclient/external/github.com/docker/go-units"
"github.com/docker/go-units"
)

// ErrContainerAlreadyExists is the error returned by CreateContainer when the
Expand Down
2 changes: 1 addition & 1 deletion container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"testing"
"time"

"github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp"
"github.com/hashicorp/go-cleanhttp"
)

func TestStateString(t *testing.T) {
Expand Down
55 changes: 0 additions & 55 deletions external/github.com/Sirupsen/logrus/CHANGELOG.md

This file was deleted.

21 changes: 0 additions & 21 deletions external/github.com/Sirupsen/logrus/LICENSE

This file was deleted.

Loading

0 comments on commit 9d5fef7

Please sign in to comment.