Skip to content

Commit

Permalink
Merge pull request #52 from lalamove/lint
Browse files Browse the repository at this point in the history
Lint
  • Loading branch information
francoispqt authored Jun 18, 2019
2 parents a3a11d4 + a42c65b commit be497fe
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func RegisterCloser(closer io.Closer) Store {
}

// RegisterCloser adds a closer to the list of closers.
// Closers are closed when an error occured while reloading a config and the ExitOnError config is set to true
// Closers are closed when an error occurred while reloading a config and the ExitOnError config is set to true
func (c *S) RegisterCloser(closer io.Closer) Store {
c.Closers = append(c.Closers, closer)
return c
Expand Down
4 changes: 2 additions & 2 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestConfigWatcherLoader(t *testing.T) {
RegisterLoader(
&DummyLoader{
[][2]string{
[2]string{
{
"foo", "bar",
},
},
Expand All @@ -110,7 +110,7 @@ func TestConfigWatcherLoader(t *testing.T) {
RegisterLoader(
&DummyLoader{
[][2]string{
[2]string{
{
"foo", "bar",
},
},
Expand Down
22 changes: 11 additions & 11 deletions loader/kletcd/etcdloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestEtcdLoader(t *testing.T) {
mockClient.EXPECT().Get(ctx, "key1").Return(
&clientv3.GetResponse{
Kvs: []*mvccpb.KeyValue{
&mvccpb.KeyValue{
{
Key: []byte(`key1`),
Value: []byte(`bar`),
},
Expand All @@ -63,7 +63,7 @@ func TestEtcdLoader(t *testing.T) {
mockClient.EXPECT().Get(ctx, "key2").Return(
&clientv3.GetResponse{
Kvs: []*mvccpb.KeyValue{
&mvccpb.KeyValue{
{
Key: []byte(`key2`),
Value: []byte(`foo`),
},
Expand Down Expand Up @@ -119,11 +119,11 @@ func TestEtcdLoader(t *testing.T) {
mockClient.EXPECT().Get(ctx, "key1").Return(
&clientv3.GetResponse{
Kvs: []*mvccpb.KeyValue{
&mvccpb.KeyValue{
{
Key: []byte(`key1`),
Value: []byte(`bar`),
},
&mvccpb.KeyValue{
{
Key: []byte(`key2`),
Value: []byte(`foo`),
},
Expand Down Expand Up @@ -180,11 +180,11 @@ func TestEtcdLoader(t *testing.T) {
mockClient.EXPECT().Get(ctx, "key1").Times(1).Return(
&clientv3.GetResponse{
Kvs: []*mvccpb.KeyValue{
&mvccpb.KeyValue{
{
Key: []byte(`key1`),
Value: []byte(`bar`),
},
&mvccpb.KeyValue{
{
Key: []byte(`key2`),
Value: []byte(`foo`),
},
Expand All @@ -209,11 +209,11 @@ func TestEtcdLoader(t *testing.T) {
mockClient.EXPECT().Get(ctx, "key1").MinTimes(1).Return(
&clientv3.GetResponse{
Kvs: []*mvccpb.KeyValue{
&mvccpb.KeyValue{
{
Key: []byte(`key1`),
Value: []byte(`bar`),
},
&mvccpb.KeyValue{
{
Key: []byte(`key`),
Value: []byte(`foo`),
},
Expand Down Expand Up @@ -265,11 +265,11 @@ func TestEtcdLoader(t *testing.T) {
mockClient.EXPECT().Get(ctx, "key1").Return(
&clientv3.GetResponse{
Kvs: []*mvccpb.KeyValue{
&mvccpb.KeyValue{
{
Key: []byte(`key1`),
Value: []byte(`bar`),
},
&mvccpb.KeyValue{
{
Key: []byte(`key2`),
Value: []byte(`foo`),
},
Expand Down Expand Up @@ -367,7 +367,7 @@ func TestEtcdLoader(t *testing.T) {
mockClient.EXPECT().Get(ctx, "key1").Return(
&clientv3.GetResponse{
Kvs: []*mvccpb.KeyValue{
&mvccpb.KeyValue{
{
Key: []byte(`key1`),
Value: []byte(`bar`),
},
Expand Down
2 changes: 1 addition & 1 deletion loader/klvault/vaultloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestVaultLoader(t *testing.T) {
},
nil,
)
lC.EXPECT().ReadWithData("dummy/secret/data/path3", map[string][]string{"version": []string{"1"}}).Return(
lC.EXPECT().ReadWithData("dummy/secret/data/path3", map[string][]string{"version": {"1"}}).Return(
&vault.Secret{
Data: map[string]interface{}{
"data": map[string]interface{}{
Expand Down
2 changes: 1 addition & 1 deletion parser/kptoml/tomlparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package kptoml
import (
"io"

"github.com/BurntSushi/toml"
"github.com/lalamove/konfig"
"github.com/lalamove/konfig/parser"
"github.com/lalamove/konfig/parser/kpmap"
"github.com/BurntSushi/toml"
)

// Parser parses the given json io.Reader and adds values in dot.path notation into the konfig.Store
Expand Down
2 changes: 1 addition & 1 deletion test/configfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestYAMLFile(t *testing.T) {
konfig.RegisterLoader(
klfile.New(&klfile.Config{
Files: []klfile.File{
klfile.File{
{
Path: "./data/cfg.yml",
Parser: kpyaml.Parser,
},
Expand Down
8 changes: 4 additions & 4 deletions value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,21 @@ func TestSetStruct(t *testing.T) {
TT: 2,
},
SubMapTPtr: map[string]*TestConfigSub{
"foo": &TestConfigSub{
"foo": {
VV: "woop",
TT: 1,
},
"bar": &TestConfigSub{
"bar": {
VV: "hello",
TT: 1,
},
},
SubMapT: map[string]TestConfigSub{
"foo": TestConfigSub{
"foo": {
VV: "woop",
TT: 1,
},
"bar": TestConfigSub{
"bar": {
VV: "hello",
TT: 1,
},
Expand Down

0 comments on commit be497fe

Please sign in to comment.