From 2de58d1f90f1425a1c63f19ffd55d40695664cf3 Mon Sep 17 00:00:00 2001 From: Matthias Loibl Date: Sun, 27 Mar 2016 01:24:09 +0100 Subject: [PATCH] Use gofmt to fmt & simplify --- controller/stream.go | 2 +- engine/engine.go | 4 ++-- engine/worker.go | 2 +- remote/bitbucket/types.go | 10 +++++----- store/datastore/jobs_test.go | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/controller/stream.go b/controller/stream.go index d6d2fea1c..920379953 100644 --- a/controller/stream.go +++ b/controller/stream.go @@ -93,7 +93,7 @@ func GetStream(c *gin.Context) { go func() { defer func() { - recover() + recover() }() <-c.Writer.CloseNotify() rc.Close() diff --git a/engine/engine.go b/engine/engine.go index 12022f329..7ce99fa38 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -305,7 +305,7 @@ func (e *engine) runJob(c context.Context, r *Task, updater *updater, client doc MemorySwappiness: -1, }, Volumes: map[string]struct{}{ - "/var/run/docker.sock": struct{}{}, + "/var/run/docker.sock": {}, }, } @@ -415,7 +415,7 @@ func (e *engine) runJobNotify(r *Task, client dockerclient.Client) error { MemorySwappiness: -1, }, Volumes: map[string]struct{}{ - "/var/run/docker.sock": struct{}{}, + "/var/run/docker.sock": {}, }, } diff --git a/engine/worker.go b/engine/worker.go index 406a1cb9f..9b3c8d8e9 100644 --- a/engine/worker.go +++ b/engine/worker.go @@ -54,7 +54,7 @@ func (w *worker) Build(name string, stdin []byte, pr bool) (_ int, err error) { Binds: []string{"/var/run/docker.sock:/var/run/docker.sock"}, }, Volumes: map[string]struct{}{ - "/var/run/docker.sock": struct{}{}, + "/var/run/docker.sock": {}, }, } diff --git a/remote/bitbucket/types.go b/remote/bitbucket/types.go index 555b4ca4c..1ad189720 100644 --- a/remote/bitbucket/types.go +++ b/remote/bitbucket/types.go @@ -22,11 +22,11 @@ type AccountResp struct { } type BuildStatus struct { - State string `json:"state"` - Key string `json:"key"` - Name string `json:"name,omitempty"` - Url string `json:"url"` - Desc string `json:"description,omitempty"` + State string `json:"state"` + Key string `json:"key"` + Name string `json:"name,omitempty"` + Url string `json:"url"` + Desc string `json:"description,omitempty"` } type Email struct { diff --git a/store/datastore/jobs_test.go b/store/datastore/jobs_test.go index 0f2edb534..bf96e6d86 100644 --- a/store/datastore/jobs_test.go +++ b/store/datastore/jobs_test.go @@ -86,19 +86,19 @@ func TestJobs(t *testing.T) { Status: model.StatusSuccess, } jobs := []*model.Job{ - &model.Job{ + { BuildID: 1, Status: "success", ExitCode: 0, Number: 1, }, - &model.Job{ + { BuildID: 3, Status: "error", ExitCode: 1, Number: 2, }, - &model.Job{ + { BuildID: 5, Status: "pending", ExitCode: 0,