Skip to content

Commit

Permalink
Upgrade Go to 1.6.
Browse files Browse the repository at this point in the history
Signed-off-by: David Calavera <[email protected]>
  • Loading branch information
calavera committed Feb 29, 2016
1 parent 776c5ee commit 14d5c91
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ RUN set -x \
# IMPORTANT: If the version of Go is updated, the Windows to Linux CI machines
# will need updating, to avoid errors. Ping #docker-maintainers on IRC
# with a heads-up.
ENV GO_VERSION 1.5.3
ENV GO_VERSION 1.6
RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" \
| tar -xzC /usr/local
ENV PATH /go/bin:/usr/local/go/bin:$PATH
Expand Down
24 changes: 13 additions & 11 deletions opts/hosts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ import (
)

func TestParseHost(t *testing.T) {
invalid := map[string]string{
"anything": "Invalid bind address format: anything",
"something with spaces": "Invalid bind address format: something with spaces",
"://": "Invalid bind address format: ://",
"unknown://": "Invalid bind address format: unknown://",
"tcp://:port": "Invalid bind address format: :port",
"tcp://invalid": "Invalid bind address format: invalid",
"tcp://invalid:port": "Invalid bind address format: invalid:port",
invalid := []string{
"anything",
"something with spaces",
"://",
"unknown://",
"tcp://:port",
"tcp://invalid",
"tcp://invalid:port",
}

valid := map[string]string{
"": DefaultHost,
" ": DefaultHost,
Expand All @@ -37,11 +38,12 @@ func TestParseHost(t *testing.T) {
"npipe:////./pipe/foo": "npipe:////./pipe/foo",
}

for value, errorMessage := range invalid {
if _, err := ParseHost(false, value); err == nil || err.Error() != errorMessage {
t.Errorf("Expected an error for %v with [%v], got [%v]", value, errorMessage, err)
for _, value := range invalid {
if _, err := ParseHost(false, value); err == nil {
t.Errorf("Expected an error for %v, got [nil]", value)
}
}

for value, expected := range valid {
if actual, err := ParseHost(false, value); err != nil || actual != expected {
t.Errorf("Expected for %v [%v], got [%v, %v]", value, expected, actual, err)
Expand Down

0 comments on commit 14d5c91

Please sign in to comment.