Selaa lähdekoodia

chore: simplify struct initialization to direct return

💘 Generated with Crush

Assisted-by: GLM-4.7 via Crush <[email protected]>
Christian Rocha 1 kuukausi sitten
vanhempi
sitoutus
b7c128a33c
1 muutettua tiedostoa jossa 1 lisäystä ja 2 poistoa
  1. 1 2
      internal/pubsub/broker.go

+ 1 - 2
internal/pubsub/broker.go

@@ -20,12 +20,11 @@ func NewBroker[T any]() *Broker[T] {
 }
 
 func NewBrokerWithOptions[T any](channelBufferSize, maxEvents int) *Broker[T] {
-	b := &Broker[T]{
+	return &Broker[T]{
 		subs:      make(map[chan Event[T]]struct{}),
 		done:      make(chan struct{}),
 		maxEvents: maxEvents,
 	}
-	return b
 }
 
 func (b *Broker[T]) Shutdown() {