Chore: Upgrade golangci-lint to v1.50.1 (#60379)
This commit is contained in:
+6
-5
@@ -6,8 +6,9 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/tracing"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/tracing"
|
||||
)
|
||||
|
||||
// HandlerFunc defines a handler function interface.
|
||||
@@ -16,16 +17,16 @@ type HandlerFunc interface{}
|
||||
// Msg defines a message interface.
|
||||
type Msg interface{}
|
||||
|
||||
// ErrHandlerNotFound defines an error if a handler is not found
|
||||
// ErrHandlerNotFound defines an error if a handler is not found.
|
||||
var ErrHandlerNotFound = errors.New("handler not found")
|
||||
|
||||
// Bus type defines the bus interface structure
|
||||
// Bus type defines the bus interface structure.
|
||||
type Bus interface {
|
||||
Publish(ctx context.Context, msg Msg) error
|
||||
AddEventListener(handler HandlerFunc)
|
||||
}
|
||||
|
||||
// InProcBus defines the bus structure
|
||||
// InProcBus defines the bus structure.
|
||||
type InProcBus struct {
|
||||
listeners map[string][]HandlerFunc
|
||||
tracer tracing.Tracer
|
||||
@@ -38,7 +39,7 @@ func ProvideBus(tracer tracing.Tracer) *InProcBus {
|
||||
}
|
||||
}
|
||||
|
||||
// PublishCtx function publish a message to the bus listener.
|
||||
// Publish function publish a message to the bus listener.
|
||||
func (b *InProcBus) Publish(ctx context.Context, msg Msg) error {
|
||||
var msgName = reflect.TypeOf(msg).Elem().Name()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user