From d019ad3a1632d1a33687edb06870b8dce6540b0a Mon Sep 17 00:00:00 2001 From: ZPascal Date: Tue, 26 May 2026 17:55:00 +0200 Subject: [PATCH] fix: Adjust the lint issues Signed-off-by: ZPascal --- services/actions/matrix.go | 8 ++------ services/actions/matrix_test.go | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/services/actions/matrix.go b/services/actions/matrix.go index cc2fe3f9f6e..8d332234b26 100644 --- a/services/actions/matrix.go +++ b/services/actions/matrix.go @@ -8,6 +8,7 @@ import ( "errors" "fmt" "maps" + "slices" "sort" "strings" @@ -165,12 +166,7 @@ func yamlNodeContainsNeedsOutputsExpr(node *yaml.Node) bool { if node.Kind == yaml.ScalarNode { return containsNeedsOutputsExpr(node.Value) } - for _, child := range node.Content { - if yamlNodeContainsNeedsOutputsExpr(child) { - return true - } - } - return false + return slices.ContainsFunc(node.Content, yamlNodeContainsNeedsOutputsExpr) } // containsNeedsOutputsExpr returns true when s contains a GitHub Actions diff --git a/services/actions/matrix_test.go b/services/actions/matrix_test.go index 1eb48a331d1..4dbe75f842f 100644 --- a/services/actions/matrix_test.go +++ b/services/actions/matrix_test.go @@ -60,7 +60,7 @@ matrix: want: false, }, { - name: "empty strategy", + name: "empty strategy", strategy: "", want: false, },