diff --git a/hack/base.mk b/hack/base.mk index 55d7269..e6539d3 100644 --- a/hack/base.mk +++ b/hack/base.mk @@ -1,5 +1,5 @@ # renovate: datasource=github-tags depName=golangci/golangci-lint -GOLANGCI_VERSION ?= v2.7.2 +GOLANGCI_VERSION ?= v2.8.0 # renovate: datasource=github-tags depName=protocolbuffers/protobuf PROTOC_VERSION ?= v33.4 TOOLS_BIN := $(shell mkdir -p build/tools && realpath build/tools) diff --git a/internal/clipboard/clipboard_test.go b/internal/clipboard/clipboard_test.go index b34c6aa..e6fad34 100644 --- a/internal/clipboard/clipboard_test.go +++ b/internal/clipboard/clipboard_test.go @@ -39,10 +39,11 @@ func TestCopy(t *testing.T) { for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { - var opts []command.Option[Options] - opts = append(opts, WithSourceProfile(tc.from)) - opts = append(opts, WithTargetProfile(tc.to)) - opts = append(opts, WithContentType(tc.target)) + opts := []command.Option[Options]{ + WithSourceProfile(tc.from), + WithTargetProfile(tc.to), + WithContentType(tc.target), + } err := Run(opts...) diff --git a/internal/flatpak/flatpak.go b/internal/flatpak/flatpak.go index f1db5b5..df042bd 100644 --- a/internal/flatpak/flatpak.go +++ b/internal/flatpak/flatpak.go @@ -51,6 +51,7 @@ func Run(opts ...command.Option[Options]) error { return fmt.Errorf("flatpak %q is not allowed for profile %q", o.Name, o.Profile) } + //nolint:prealloc args := []string{"run", o.Name} args = append(args, o.ExtraArgs...) diff --git a/internal/profiles/profiles.go b/internal/profiles/profiles.go index 61c45d7..a27911a 100644 --- a/internal/profiles/profiles.go +++ b/internal/profiles/profiles.go @@ -475,7 +475,8 @@ func createNewDisplay(bin string, ca, cert, key []byte, profile *types.Profile, "-auth", "/home/xorg-user/.Xserver", "-verbose", "9", "--", - strings.TrimPrefix(profile.WindowManager, "exec ")} + strings.TrimPrefix(profile.WindowManager, "exec "), + } } server, err := files.ServerCookiePath(profile.Name) @@ -529,7 +530,6 @@ func createNewDisplay(bin string, ca, cert, key []byte, profile *types.Profile, x11Dir = fp } - //nolint var paths []string paths = append(paths, "-v=/etc/localtime:/etc/localtime:ro") paths = append(paths, fmt.Sprintf("-v=%s:/tmp/.X11-unix:rw", x11Dir)) diff --git a/internal/runners/docker/run.go b/internal/runners/docker/run.go index d1eb80c..9879059 100644 --- a/internal/runners/docker/run.go +++ b/internal/runners/docker/run.go @@ -22,9 +22,7 @@ import ( "golang.org/x/sys/execabs" ) -var ( - runnerBinary = files.ContainerRunnerBinary("docker") -) +var runnerBinary = files.ContainerRunnerBinary("docker") func Run(ew types.EffectiveWorkload) error { if err := ew.Validate(); err != nil { @@ -346,6 +344,7 @@ func hostDbusParams() []string { } func cameraParams() []string { + //nolint:prealloc params := []string{ "--group-add=video", } diff --git a/internal/runners/podman/run.go b/internal/runners/podman/run.go index 3e229ea..7de40c9 100644 --- a/internal/runners/podman/run.go +++ b/internal/runners/podman/run.go @@ -22,9 +22,7 @@ import ( "golang.org/x/sys/execabs" ) -var ( - runnerBinary = files.ContainerRunnerBinary("podman") -) +var runnerBinary = files.ContainerRunnerBinary("podman") func Run(ew types.EffectiveWorkload) error { if err := ew.Validate(); err != nil { @@ -322,6 +320,7 @@ func hostDbusParams() []string { } func cameraParams() []string { + //nolint:prealloc params := []string{} vds, _ := filepath.Glob("/dev/video*") diff --git a/internal/runners/util/container/container.go b/internal/runners/util/container/container.go index f4f547a..aec06ca 100644 --- a/internal/runners/util/container/container.go +++ b/internal/runners/util/container/container.go @@ -26,6 +26,7 @@ func ID(bin, name string) (string, bool) { } func Exec(bin, id string, ew types.EffectiveWorkload) error { + //nolint:prealloc args := []string{"exec", "--detach", id, ew.Workload.Command} args = append(args, ew.Workload.Args...)