mirror of https://github.com/docker/docs.git
gofmt
This commit is contained in:
parent
8e71391572
commit
b00d5f0185
|
@ -50,7 +50,6 @@ func (eng *Engine) Register(name string, handler Handler) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// New initializes a new engine managing the directory specified at `root`.
|
// New initializes a new engine managing the directory specified at `root`.
|
||||||
// `root` is used to store containers and any other state private to the engine.
|
// `root` is used to store containers and any other state private to the engine.
|
||||||
// Changing the contents of the root without executing a job will cause unspecified
|
// Changing the contents of the root without executing a job will cause unspecified
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
package engine
|
package engine
|
||||||
|
|
||||||
|
|
||||||
type Hack map[string]interface{}
|
type Hack map[string]interface{}
|
||||||
|
|
||||||
|
|
||||||
func (eng *Engine) Hack_GetGlobalVar(key string) interface{} {
|
func (eng *Engine) Hack_GetGlobalVar(key string) interface{} {
|
||||||
if eng.hack == nil {
|
if eng.hack == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -3,14 +3,14 @@ package engine
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"fmt"
|
|
||||||
"sync"
|
"sync"
|
||||||
"encoding/json"
|
|
||||||
"os"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// A job is the fundamental unit of work in the docker engine.
|
// A job is the fundamental unit of work in the docker engine.
|
||||||
|
@ -106,13 +106,17 @@ func (job *Job) parseLines(src io.Reader, dst *[]string, limit int) {
|
||||||
func (job *Job) StdoutParseString(dst *string) {
|
func (job *Job) StdoutParseString(dst *string) {
|
||||||
lines := make([]string, 0, 1)
|
lines := make([]string, 0, 1)
|
||||||
job.StdoutParseLines(&lines, 1)
|
job.StdoutParseLines(&lines, 1)
|
||||||
job.onExit = append(job.onExit, func() { if len(lines) >= 1 { *dst = lines[0] }})
|
job.onExit = append(job.onExit, func() {
|
||||||
|
if len(lines) >= 1 {
|
||||||
|
*dst = lines[0]
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (job *Job) StderrParseString(dst *string) {
|
func (job *Job) StderrParseString(dst *string) {
|
||||||
lines := make([]string, 0, 1)
|
lines := make([]string, 0, 1)
|
||||||
job.StderrParseLines(&lines, 1)
|
job.StderrParseLines(&lines, 1)
|
||||||
job.onExit = append(job.onExit, func() { *dst = lines[0]; })
|
job.onExit = append(job.onExit, func() { *dst = lines[0] })
|
||||||
}
|
}
|
||||||
|
|
||||||
func (job *Job) StdoutPipe() io.ReadCloser {
|
func (job *Job) StdoutPipe() io.ReadCloser {
|
||||||
|
@ -129,7 +133,6 @@ func (job *Job) StderrPipe() io.ReadCloser {
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (job *Job) CallString() string {
|
func (job *Job) CallString() string {
|
||||||
return fmt.Sprintf("%s(%s)", job.Name, strings.Join(job.Args, ", "))
|
return fmt.Sprintf("%s(%s)", job.Name, strings.Join(job.Args, ", "))
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
@ -18,7 +19,6 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
"net/url"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -74,7 +74,6 @@ func jobInitApi(job *engine.Job) string {
|
||||||
return "0"
|
return "0"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (srv *Server) ListenAndServe(job *engine.Job) string {
|
func (srv *Server) ListenAndServe(job *engine.Job) string {
|
||||||
protoAddrs := job.Args
|
protoAddrs := job.Args
|
||||||
chErrors := make(chan error, len(protoAddrs))
|
chErrors := make(chan error, len(protoAddrs))
|
||||||
|
|
|
@ -2,8 +2,8 @@ package docker
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/dotcloud/docker/utils"
|
"github.com/dotcloud/docker/utils"
|
||||||
"strings"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
|
@ -66,7 +66,6 @@ func mkServerFromEngine(eng *engine.Engine, t utils.Fataler) *Server {
|
||||||
return srv
|
return srv
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func NewTestEngine(t utils.Fataler) *engine.Engine {
|
func NewTestEngine(t utils.Fataler) *engine.Engine {
|
||||||
root, err := newTestDirectory(unitTestStoreBase)
|
root, err := newTestDirectory(unitTestStoreBase)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue