From f606426f00e9ad59f078474d4005ec55d1f3d3a9 Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Sun, 28 Jan 2018 19:03:27 +0300 Subject: [PATCH] CS --- pool_test.go | 4 ++-- protocol.go | 4 ++-- worker.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pool_test.go b/pool_test.go index bada2fe87..c87f4ea7f 100644 --- a/pool_test.go +++ b/pool_test.go @@ -77,7 +77,7 @@ func Test_Pool_Echo(t *testing.T) { assert.Equal(t, "hello", res.String()) } -func Test_Pool_Echo_NilHead(t *testing.T) { +func Test_Pool_Echo_NilContext(t *testing.T) { p, err := NewPool( func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") }, NewPipeFactory(), @@ -98,7 +98,7 @@ func Test_Pool_Echo_NilHead(t *testing.T) { assert.Equal(t, "hello", res.String()) } -func Test_Pool_Echo_Head(t *testing.T) { +func Test_Pool_Echo_Context(t *testing.T) { p, err := NewPool( func() *exec.Cmd { return exec.Command("php", "tests/client.php", "head", "pipes") }, NewPipeFactory(), diff --git a/protocol.go b/protocol.go index 97d40c0cb..564df9b78 100644 --- a/protocol.go +++ b/protocol.go @@ -15,7 +15,7 @@ type pidCommand struct { Pid int `json:"pid"` } -func sendHead(rl goridge.Relay, v interface{}) error { +func sendPayload(rl goridge.Relay, v interface{}) error { if data, ok := v.([]byte); ok { return rl.Send(data, goridge.PayloadControl|goridge.PayloadRaw) } @@ -29,7 +29,7 @@ func sendHead(rl goridge.Relay, v interface{}) error { } func fetchPID(rl goridge.Relay) (pid int, err error) { - if err := sendHead(rl, pidCommand{Pid: os.Getpid()}); err != nil { + if err := sendPayload(rl, pidCommand{Pid: os.Getpid()}); err != nil { return 0, err } diff --git a/worker.go b/worker.go index df97871e7..cc37b69d8 100644 --- a/worker.go +++ b/worker.go @@ -126,7 +126,7 @@ func (w *Worker) Stop() error { defer w.mu.Unlock() w.state.set(StateInactive) - err := sendHead(w.rl, &stopCommand{Stop: true}) + err := sendPayload(w.rl, &stopCommand{Stop: true}) <-w.waitDone return err @@ -209,7 +209,7 @@ func (w *Worker) start() error { } func (w *Worker) execPayload(rqs *Payload) (rsp *Payload, err error) { - if err := sendHead(w.rl, rqs.Context); err != nil { + if err := sendPayload(w.rl, rqs.Context); err != nil { return nil, errors.Wrap(err, "header error") }