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 authored and rheinwein committed May 2, 2016
1 parent eaf741d commit d365846
Show file tree
Hide file tree
Showing 184 changed files with 37 additions and 23,570 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.2
- 1.5.4
- 1.6.1
- 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.0
- GOARCH=386 DOCKER_VERSION=1.11.0
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:
$(foreach pkg,$(PKGS),go vet $(pkg);)
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:
$(foreach pkg,$(PKGS),go test $(pkg) || exit;)
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 @@ -29,10 +29,10 @@ import (
"strings"
"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 @@ -747,12 +747,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 @@ -19,7 +19,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 @@ -22,7 +22,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

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 d365846

Please sign in to comment.