From 8f3b8f383519452001cc05bf6505e9c301ebe954 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 6 Jan 2014 22:14:35 -0700 Subject: [PATCH] Run 'gofmt -s -w' --- engine/http.go | 4 ++-- reflink_copy_darwin.go | 2 +- reflink_copy_linux.go | 2 +- utils.go | 1 - utils/utils.go | 2 +- utils/utils_test.go | 6 +++--- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/engine/http.go b/engine/http.go index 6391b3ff5a..b115912e2c 100644 --- a/engine/http.go +++ b/engine/http.go @@ -1,8 +1,8 @@ package engine import ( - "path" "net/http" + "path" ) // ServeHTTP executes a job as specified by the http request `r`, and sends the @@ -22,7 +22,7 @@ func (eng *Engine) ServeHTTP(w http.ResponseWriter, r *http.Request) { jobArgs = []string{} } w.Header().Set("Job-Name", jobName) - for _, arg := range(jobArgs) { + for _, arg := range jobArgs { w.Header().Add("Job-Args", arg) } job := eng.Job(jobName, jobArgs...) diff --git a/reflink_copy_darwin.go b/reflink_copy_darwin.go index 3f3147db0f..4f0ea8c4fd 100644 --- a/reflink_copy_darwin.go +++ b/reflink_copy_darwin.go @@ -1,8 +1,8 @@ package docker import ( - "os" "io" + "os" ) func CopyFile(dstFile, srcFile *os.File) error { diff --git a/reflink_copy_linux.go b/reflink_copy_linux.go index 8aae3abf3d..83c7f75413 100644 --- a/reflink_copy_linux.go +++ b/reflink_copy_linux.go @@ -25,8 +25,8 @@ btrfs_reflink(int fd_out, int fd_in) import "C" import ( - "os" "io" + "os" "syscall" ) diff --git a/utils.go b/utils.go index 5bcc678184..3eb1eac045 100644 --- a/utils.go +++ b/utils.go @@ -322,7 +322,6 @@ func migratePortMappings(config *Config, hostConfig *HostConfig) error { return nil } - // Links come in the format of // name:alias func parseLink(rawLink string) (map[string]string, error) { diff --git a/utils/utils.go b/utils/utils.go index 25c8012c54..d5dbf35f0a 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -781,7 +781,7 @@ func ParseHost(defaultHost string, defaultPort int, defaultUnix, addr string) (s host string port int ) - addr = strings.TrimSpace(addr) + addr = strings.TrimSpace(addr) switch { case strings.HasPrefix(addr, "unix://"): proto = "unix" diff --git a/utils/utils_test.go b/utils/utils_test.go index bd3cf2274d..1f23755d11 100644 --- a/utils/utils_test.go +++ b/utils/utils_test.go @@ -316,9 +316,9 @@ func TestParseHost(t *testing.T) { if addr, err := ParseHost(defaultHttpHost, defaultHttpPort, defaultUnix, "tcp://:7777"); err != nil || addr != "tcp://127.0.0.1:7777" { t.Errorf("tcp://:7777 -> expected tcp://127.0.0.1:7777, got %s", addr) } - if addr, err := ParseHost(defaultHttpHost, defaultHttpPort, defaultUnix, ""); err != nil || addr != "unix:///var/run/docker.sock" { - t.Errorf("empty argument -> expected unix:///var/run/docker.sock, got %s", addr) - } + if addr, err := ParseHost(defaultHttpHost, defaultHttpPort, defaultUnix, ""); err != nil || addr != "unix:///var/run/docker.sock" { + t.Errorf("empty argument -> expected unix:///var/run/docker.sock, got %s", addr) + } if addr, err := ParseHost(defaultHttpHost, defaultHttpPort, defaultUnix, "unix:///var/run/docker.sock"); err != nil || addr != "unix:///var/run/docker.sock" { t.Errorf("unix:///var/run/docker.sock -> expected unix:///var/run/docker.sock, got %s", addr) }