diff --git a/.github/workflows/golangcilint.yml b/.github/workflows/golangcilint.yml index ff02106f..4d34f062 100644 --- a/.github/workflows/golangcilint.yml +++ b/.github/workflows/golangcilint.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/setup-go@v6 with: go-version: "1.25" - lint-version: "v2.7.2" + lint-version: "v2.8.0" check-latest: true - uses: actions/checkout@v6 - name: golangci-lint diff --git a/internal/testutils/repotest/repotest.go b/internal/testutils/repotest/repotest.go index 1e0f1e45..86fa5cb5 100644 --- a/internal/testutils/repotest/repotest.go +++ b/internal/testutils/repotest/repotest.go @@ -230,7 +230,11 @@ type Repo struct { // TaskIDs returns the tasks ids (.) of all tasks in the AppCfgs slice func (r *Repo) TaskIDs() []string { - var result []string + totalTasks := 0 + for _, appCfg := range r.AppCfgs { + totalTasks += len(appCfg.Tasks) + } + result := make([]string, 0, totalTasks) for _, appCfg := range r.AppCfgs { for _, task := range appCfg.Tasks { diff --git a/pkg/baur/loader.go b/pkg/baur/loader.go index 64c832dd..b7e01a72 100644 --- a/pkg/baur/loader.go +++ b/pkg/baur/loader.go @@ -62,8 +62,6 @@ func NewLoader(repoCfg *cfg.Repository, gitCommitIDFunc func() (string, error), // If no specifier is passed all tasks of all apps are returned. // If multiple specifiers match the same task, it's only returned 1x in the returned slice. func (a *Loader) LoadTasks(specifier ...string) ([]*Task, error) { - var result []*Task - specs, err := parseSpecs(specifier) if err != nil { return nil, err @@ -80,7 +78,7 @@ func (a *Loader) LoadTasks(specifier ...string) ([]*Task, error) { return a.allTasks(apps) } - result, err = a.allTasks(apps) + result, err := a.allTasks(apps) if err != nil { return nil, err }