From 823cd4a370e2aa7fe9d4bccc0cae9940bb88fa84 Mon Sep 17 00:00:00 2001 From: Milos Gajdos Date: Sun, 3 Sep 2023 23:33:20 +0100 Subject: [PATCH] Add a comment why prealloc linter is disabled when configuring endpoints Signed-off-by: Milos Gajdos --- registry/handlers/app.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/registry/handlers/app.go b/registry/handlers/app.go index bd3a60d7..7e0b418c 100644 --- a/registry/handlers/app.go +++ b/registry/handlers/app.go @@ -441,6 +441,10 @@ func (app *App) register(routeName string, dispatch dispatchFunc) { // configureEvents prepares the event sink for action. func (app *App) configureEvents(configuration *configuration.Configuration) { // Configure all of the endpoint sinks. + // NOTE(milosgajdos): we are disabling the linter here as + // if an endpoint is disabled we continue with the evaluation + // of the next one so we do not know the exact size the slice + // should have at the time the iteration starts // nolint:prealloc var sinks []events.Sink for _, endpoint := range configuration.Notifications.Endpoints {