Run 'gofmt -s -w'

This commit is contained in:
Tianon Gravi 2014-01-06 22:14:35 -07:00
parent fca83b4cfb
commit 8f3b8f3835
6 changed files with 8 additions and 9 deletions

View file

@ -1,8 +1,8 @@
package engine package engine
import ( import (
"path"
"net/http" "net/http"
"path"
) )
// ServeHTTP executes a job as specified by the http request `r`, and sends the // 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{} jobArgs = []string{}
} }
w.Header().Set("Job-Name", jobName) w.Header().Set("Job-Name", jobName)
for _, arg := range(jobArgs) { for _, arg := range jobArgs {
w.Header().Add("Job-Args", arg) w.Header().Add("Job-Args", arg)
} }
job := eng.Job(jobName, jobArgs...) job := eng.Job(jobName, jobArgs...)

View file

@ -1,8 +1,8 @@
package docker package docker
import ( import (
"os"
"io" "io"
"os"
) )
func CopyFile(dstFile, srcFile *os.File) error { func CopyFile(dstFile, srcFile *os.File) error {

View file

@ -25,8 +25,8 @@ btrfs_reflink(int fd_out, int fd_in)
import "C" import "C"
import ( import (
"os"
"io" "io"
"os"
"syscall" "syscall"
) )

View file

@ -322,7 +322,6 @@ func migratePortMappings(config *Config, hostConfig *HostConfig) error {
return nil return nil
} }
// Links come in the format of // Links come in the format of
// name:alias // name:alias
func parseLink(rawLink string) (map[string]string, error) { func parseLink(rawLink string) (map[string]string, error) {

View file

@ -781,7 +781,7 @@ func ParseHost(defaultHost string, defaultPort int, defaultUnix, addr string) (s
host string host string
port int port int
) )
addr = strings.TrimSpace(addr) addr = strings.TrimSpace(addr)
switch { switch {
case strings.HasPrefix(addr, "unix://"): case strings.HasPrefix(addr, "unix://"):
proto = "unix" proto = "unix"

View file

@ -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" { 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) 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" { 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) 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" { 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) t.Errorf("unix:///var/run/docker.sock -> expected unix:///var/run/docker.sock, got %s", addr)
} }