Skip to content

Commit cda3127

Browse files
authored
Merge pull request #69 from SamWhited/modules
Use Go Modules
2 parents 7dc0a2d + c6b1cad commit cda3127

File tree

4 files changed

+46
-15
lines changed

4 files changed

+46
-15
lines changed

circle.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
version: 2
22
jobs:
33
build:
4-
machine: true
5-
working_directory: ~/go/src/github.com/docker/go-connections
4+
machine:
5+
image: ubuntu-1604:202004-01
66
steps:
77
- checkout
88
- run:
@@ -11,10 +11,7 @@ jobs:
1111
- run:
1212
name: Get dependencies
1313
command: |
14-
go get -u golang.org/x/lint/golint &&
15-
go get -d github.com/pkg/errors &&
16-
go get -d github.com/stretchr/testify &&
17-
go get -d golang.org/x/net/proxy
14+
go get -u golang.org/x/lint/golint
1815
- run:
1916
name: Run analysis before tests
2017
command: go vet ./...
@@ -35,7 +32,6 @@ jobs:
3532
- run:
3633
name: Build for Windows
3734
command: |
38-
go get -d github.com/Microsoft/go-winio &&
3935
go build ./...
4036
environment:
4137
GOOS: windows

go.mod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module github.com/docker/go-connections
2+
3+
go 1.13
4+
5+
require (
6+
github.com/Microsoft/go-winio v0.4.14
7+
github.com/pkg/errors v0.9.1
8+
)

go.sum

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU=
2+
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
3+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
4+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5+
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
6+
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
7+
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
8+
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
9+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
10+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
11+
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
12+
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
13+
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
14+
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
15+
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA=
16+
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

nat/nat_test.go

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package nat
22

33
import (
4+
"reflect"
45
"testing"
5-
6-
"github.com/stretchr/testify/assert"
76
)
87

98
func TestParsePort(t *testing.T) {
@@ -175,7 +174,9 @@ func TestSplitProtoPort(t *testing.T) {
175174

176175
func TestParsePortSpecFull(t *testing.T) {
177176
portMappings, err := ParsePortSpec("0.0.0.0:1234-1235:3333-3334/tcp")
178-
assert.Nil(t, err)
177+
if err != nil {
178+
t.Fatalf("expected nil error, got: %v", err)
179+
}
179180

180181
expected := []PortMapping{
181182
{
@@ -194,12 +195,16 @@ func TestParsePortSpecFull(t *testing.T) {
194195
},
195196
}
196197

197-
assert.Equal(t, expected, portMappings)
198+
if !reflect.DeepEqual(expected, portMappings) {
199+
t.Fatalf("wrong port mappings: got=%v, want=%v", portMappings, expected)
200+
}
198201
}
199202

200203
func TestPartPortSpecIPV6(t *testing.T) {
201204
portMappings, err := ParsePortSpec("[2001:4860:0:2001::68]::333")
202-
assert.Nil(t, err)
205+
if err != nil {
206+
t.Fatalf("expected nil error, got: %v", err)
207+
}
203208

204209
expected := []PortMapping{
205210
{
@@ -210,12 +215,16 @@ func TestPartPortSpecIPV6(t *testing.T) {
210215
},
211216
},
212217
}
213-
assert.Equal(t, expected, portMappings)
218+
if !reflect.DeepEqual(expected, portMappings) {
219+
t.Fatalf("wrong port mappings: got=%v, want=%v", portMappings, expected)
220+
}
214221
}
215222

216223
func TestPartPortSpecIPV6WithHostPort(t *testing.T) {
217224
portMappings, err := ParsePortSpec("[::1]:80:80")
218-
assert.Nil(t, err)
225+
if err != nil {
226+
t.Fatalf("expected nil error, got: %v", err)
227+
}
219228

220229
expected := []PortMapping{
221230
{
@@ -226,7 +235,9 @@ func TestPartPortSpecIPV6WithHostPort(t *testing.T) {
226235
},
227236
},
228237
}
229-
assert.Equal(t, expected, portMappings)
238+
if !reflect.DeepEqual(expected, portMappings) {
239+
t.Fatalf("wrong port mappings: got=%v, want=%v", portMappings, expected)
240+
}
230241
}
231242

232243
func TestParsePortSpecs(t *testing.T) {

0 commit comments

Comments
 (0)