Chore: Upgrade golangci-lint to v1.50.1 (#60379)

This commit is contained in:
Emil Tullstedt
2022-12-15 12:58:48 +01:00
committed by GitHub
parent efd827fd65
commit b7fc837c35
5 changed files with 690 additions and 64 deletions
+6 -5
View File
@@ -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()