From 2c22772b40c7d267035ac1d70e4365ca9bd3035c Mon Sep 17 00:00:00 2001 From: Antoine Jacquemin Date: Thu, 28 Nov 2024 21:44:49 +0100 Subject: [PATCH] fix lint --- cmd/gateway_validate.go | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/cmd/gateway_validate.go b/cmd/gateway_validate.go index 561c7fe57..7999da537 100644 --- a/cmd/gateway_validate.go +++ b/cmd/gateway_validate.go @@ -212,23 +212,21 @@ this command unless --online flag is used. validateCmdKongStateFile = []string{"-"} } - if validateCmdOnlineEntitiesFilter != nil { - // Iterate over the input values and validate them against the keys in entityMap - for _, value := range validateCmdOnlineEntitiesFilter { - // Check if the value is valid by comparing it with keys in entityMap - isValid := false - for key := range validate.EntityMap { - if value == key { - isValid = true - break - } + // Iterate over the input values and validate them against the keys in entityMap + for _, value := range validateCmdOnlineEntitiesFilter { + // Check if the value is valid by comparing it with keys in entityMap + isValid := false + for key := range validate.EntityMap { + if value == key { + isValid = true + break } + } - if !isValid { - // Generate an error message stating that the value should be part of Kong entities - return fmt.Errorf("invalid value '%s' for --check-online-plugins-only; it should be a valid Kong entity", - value) - } + if !isValid { + // Generate an error message stating that the value should be part of Kong entities + return fmt.Errorf("invalid value '%s' for --check-online-plugins-only; it should be a valid Kong entity", + value) } } return preRunSilenceEventsFlag()