Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
blockloop committed Jan 9, 2020
1 parent 3cd025c commit 4aa3200
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/receive/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ type peerGroup struct {
cache map[string]storepb.WriteableStoreClient
m sync.Mutex

// dialer is used for testing
// dialer is used for testing.
dialer func(ctx context.Context, target string, opts ...grpc.DialOption) (conn *grpc.ClientConn, err error)
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/receive/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ func newHandlerHashring(appendables []*fakeAppendable, replicationFactor uint64)
}
var handlers []*Handler
// create a fake peer group where we manually fill the cache with fake addresses pointed to our handlers
// This removes the network from the tests and creates a more consistent testing harness
// This removes the network from the tests and creates a more consistent testing harness.
peers := &peerGroup{
dialOpts: nil,
m: sync.Mutex{},
cache: map[string]storepb.WriteableStoreClient{},
dialer: func(context.Context, string, ...grpc.DialOption) (*grpc.ClientConn, error) {
// dialer should never be called since we are creating fake clients with fake addresses
// this protects against some leaking test that may attempt to dial random IP addresses
// which may pose a security risk
// which may pose a security risk.
return nil, errors.New("unexpected dial called in testing")
},
}
Expand Down

0 comments on commit 4aa3200

Please sign in to comment.