Use gofmt to fmt & simplify

This commit is contained in:
Matthias Loibl 2016-03-27 01:24:09 +01:00
parent 310be64c3b
commit 2de58d1f90
5 changed files with 12 additions and 12 deletions

View file

@ -93,7 +93,7 @@ func GetStream(c *gin.Context) {
go func() {
defer func() {
recover()
recover()
}()
<-c.Writer.CloseNotify()
rc.Close()

View file

@ -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": {},
},
}

View file

@ -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": {},
},
}

View file

@ -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 {

View file

@ -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,