Skip to content

Commit

Permalink
Merge pull request #12 from krakend/deepsource-autofix-bd81315b
Browse files Browse the repository at this point in the history
refactor: replace empty slice literal with `var`
  • Loading branch information
kpacha authored Jan 14, 2025
2 parents 38c5d72 + 5f8fee6 commit bc5d83a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/cel.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ type InterpretableDefinition struct {
}

func ConfigGetter(e config.ExtraConfig) ([]InterpretableDefinition, bool) {
def := []InterpretableDefinition{}
var def []InterpretableDefinition

v, ok := e[Namespace]
if !ok {
return def, ok
Expand Down Expand Up @@ -106,7 +107,8 @@ func (p Parser) ParseJWT(definitions []InterpretableDefinition) ([]cel.Program,
}

func (p Parser) parseByKey(definitions []InterpretableDefinition, key string) ([]cel.Program, error) {
res := []cel.Program{}
var res []cel.Program

for _, def := range definitions {
if !strings.Contains(p.extractor(def), key) {
continue
Expand Down

0 comments on commit bc5d83a

Please sign in to comment.