Skip to content

Commit

Permalink
[chore] use slices.Concat instead of a series of append (#10879)
Browse files Browse the repository at this point in the history
Follows
#10869

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
  • Loading branch information
codeboten authored Aug 13, 2024
1 parent 70f58ce commit b0085e5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cmd/builder/internal/builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"os"
"os/exec"
"path/filepath"
"slices"
"strings"
"text/template"
"time"
Expand Down Expand Up @@ -221,13 +222,8 @@ func (c *Config) coreModuleAndVersion() (string, string) {
}

func (c *Config) allComponents() []Module {
// TODO: Use slices.Concat when we drop support for Go 1.21
return append(c.Exporters,
append(c.Receivers,
append(c.Processors,
append(c.Extensions,
append(c.Connectors,
*c.Providers...)...)...)...)...)
return slices.Concat[[]Module](c.Exporters, c.Receivers, c.Processors,
c.Extensions, c.Connectors, *c.Providers)
}

func (c *Config) readGoModFile() (string, map[string]string, error) {
Expand Down

0 comments on commit b0085e5

Please sign in to comment.