fix golint issues in zrpc (#531)
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
// ServerOption defines the method to customize a rpcServerOptions.
|
||||
ServerOption func(options *rpcServerOptions)
|
||||
|
||||
rpcServerOptions struct {
|
||||
@@ -26,6 +27,7 @@ func init() {
|
||||
InitLogger()
|
||||
}
|
||||
|
||||
// NewRpcServer returns a Server.
|
||||
func NewRpcServer(address string, opts ...ServerOption) Server {
|
||||
var options rpcServerOptions
|
||||
for _, opt := range opts {
|
||||
@@ -76,6 +78,7 @@ func (s *rpcServer) Start(register RegisterFn) error {
|
||||
return server.Serve(lis)
|
||||
}
|
||||
|
||||
// WithMetrics returns a func that sets metrics to a Server.
|
||||
func WithMetrics(metrics *stat.Metrics) ServerOption {
|
||||
return func(options *rpcServerOptions) {
|
||||
options.metrics = metrics
|
||||
|
||||
Reference in New Issue
Block a user