summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-09-10 14:29:10 +0300
committerWolfy-J <[email protected]>2018-09-10 14:29:10 +0300
commit7ab1e77f2db902cf8a485e3a28bfdbd58a613dc9 (patch)
tree748253cb7d5b758a0b61ab4a88023e5fed4f4a3b /service
parentceb5033d5bb2fb641c886d4010f05498552152c2 (diff)
go fmt
Diffstat (limited to 'service')
-rw-r--r--service/env/environment.go2
-rw-r--r--service/env/service_test.go7
-rw-r--r--service/http/service_test.go2
-rw-r--r--service/rpc/service.go3
-rw-r--r--service/rpc/service_test.go8
-rw-r--r--service/static/config.go2
6 files changed, 12 insertions, 12 deletions
diff --git a/service/env/environment.go b/service/env/environment.go
index d095009c..8e89d2c8 100644
--- a/service/env/environment.go
+++ b/service/env/environment.go
@@ -8,4 +8,4 @@ type Environment interface {
// SetEnv sets or creates environment value.
SetEnv(key, value string)
-} \ No newline at end of file
+}
diff --git a/service/env/service_test.go b/service/env/service_test.go
index 10159857..5b148207 100644
--- a/service/env/service_test.go
+++ b/service/env/service_test.go
@@ -23,15 +23,14 @@ func Test_Extend(t *testing.T) {
assert.Equal(t, "value", values["key"])
}
-
func Test_Set(t *testing.T) {
s := NewService(map[string]string{"rr": "version"})
s.Init(&Config{Values: map[string]string{"key": "value"}})
assert.Len(t, s.values, 2)
- s.SetEnv("key","value-new")
- s.SetEnv("other","new")
+ s.SetEnv("key", "value-new")
+ s.SetEnv("other", "new")
values, err := s.GetEnv()
assert.NoError(t, err)
@@ -39,4 +38,4 @@ func Test_Set(t *testing.T) {
assert.Equal(t, "version", values["rr"])
assert.Equal(t, "value-new", values["key"])
assert.Equal(t, "new", values["other"])
-} \ No newline at end of file
+}
diff --git a/service/http/service_test.go b/service/http/service_test.go
index 4e572335..9a5a3a9b 100644
--- a/service/http/service_test.go
+++ b/service/http/service_test.go
@@ -6,6 +6,7 @@ import (
"github.com/sirupsen/logrus/hooks/test"
"github.com/spiral/roadrunner"
"github.com/spiral/roadrunner/service"
+ "github.com/spiral/roadrunner/service/env"
"github.com/spiral/roadrunner/service/rpc"
"github.com/stretchr/testify/assert"
"io/ioutil"
@@ -13,7 +14,6 @@ import (
"os"
"testing"
"time"
- "github.com/spiral/roadrunner/service/env"
)
type testCfg struct {
diff --git a/service/rpc/service.go b/service/rpc/service.go
index 9cd32755..14e34319 100644
--- a/service/rpc/service.go
+++ b/service/rpc/service.go
@@ -3,9 +3,9 @@ package rpc
import (
"errors"
"github.com/spiral/goridge"
+ "github.com/spiral/roadrunner/service/env"
"net/rpc"
"sync"
- "github.com/spiral/roadrunner/service/env"
)
const (
@@ -16,6 +16,7 @@ const (
// rpc server connection.
EnvKey = "RR_RPC"
)
+
// Service is RPC service.
type Service struct {
cfg *Config
diff --git a/service/rpc/service_test.go b/service/rpc/service_test.go
index e47e9cdd..59e0e05d 100644
--- a/service/rpc/service_test.go
+++ b/service/rpc/service_test.go
@@ -30,7 +30,7 @@ func Test_RegisterNotConfigured(t *testing.T) {
func Test_Enabled(t *testing.T) {
s := &Service{}
- ok, err := s.Init(&Config{Enable: true, Listen: "tcp://localhost:9008"},nil)
+ ok, err := s.Init(&Config{Enable: true, Listen: "tcp://localhost:9008"}, nil)
assert.NoError(t, err)
assert.True(t, ok)
@@ -38,7 +38,7 @@ func Test_Enabled(t *testing.T) {
func Test_StopNonServing(t *testing.T) {
s := &Service{}
- ok, err := s.Init(&Config{Enable: true, Listen: "tcp://localhost:9008"},nil)
+ ok, err := s.Init(&Config{Enable: true, Listen: "tcp://localhost:9008"}, nil)
assert.NoError(t, err)
assert.True(t, ok)
@@ -47,7 +47,7 @@ func Test_StopNonServing(t *testing.T) {
func Test_Serve_Errors(t *testing.T) {
s := &Service{}
- ok, err := s.Init(&Config{Enable: true, Listen: "mailformed"},nil)
+ ok, err := s.Init(&Config{Enable: true, Listen: "mailformed"}, nil)
assert.NoError(t, err)
assert.True(t, ok)
@@ -60,7 +60,7 @@ func Test_Serve_Errors(t *testing.T) {
func Test_Serve_Client(t *testing.T) {
s := &Service{}
- ok, err := s.Init(&Config{Enable: true, Listen: "tcp://localhost:9018"},nil)
+ ok, err := s.Init(&Config{Enable: true, Listen: "tcp://localhost:9018"}, nil)
assert.NoError(t, err)
assert.True(t, ok)
diff --git a/service/static/config.go b/service/static/config.go
index 0ec1c8d8..be0ac3ed 100644
--- a/service/static/config.go
+++ b/service/static/config.go
@@ -1,11 +1,11 @@
package static
import (
+ "fmt"
"github.com/spiral/roadrunner/service"
"os"
"path"
"strings"
- "fmt"
)
// Config describes file location and controls access to them.