From 0b864460335c3db20c0c050d17a13f55914949b6 Mon Sep 17 00:00:00 2001 From: Damiano Donati Date: Sun, 30 Jun 2024 12:15:25 +0200 Subject: [PATCH] bump lint --- .github/workflows/golangci-lint.yml | 14 ++++++-------- cmd/gom/cmd/play.go | 10 ++++++---- cmd/gom/cmd/version.go | 2 +- internal/oci/pull.go | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index cf8e8c9..78c7e6f 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -14,14 +14,12 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: 1.19 - - - uses: actions/checkout@v3 - + go-version: 1.22 - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: - version: v1.50.1 + version: v1.57 + args: ./cmd/... ./internal/... diff --git a/cmd/gom/cmd/play.go b/cmd/gom/cmd/play.go index 4864d83..8c3f4c6 100644 --- a/cmd/gom/cmd/play.go +++ b/cmd/gom/cmd/play.go @@ -23,6 +23,8 @@ import ( "github.com/spf13/cobra" ) +const hostFwdPrefix = ",hostfwd=tcp::" + // playCmd is gom play. var playCmd = &cobra.Command{ Use: "play", @@ -371,9 +373,9 @@ func setNetworkingArgs(qemuArgs *[]string) (bool, error) { netNatDefault := []string{ "-device", "e1000,netdev=net0", "-netdev", "user,id=net0" + - ",hostfwd=tcp::" + fmt.Sprint(freePorts[0]) + "-:80" + - ",hostfwd=tcp::" + fmt.Sprint(freePorts[1]) + "-:443" + - ",hostfwd=tcp::" + fmt.Sprint(freePorts[2]) + "-:22", + hostFwdPrefix + fmt.Sprint(freePorts[0]) + "-:80" + + hostFwdPrefix + fmt.Sprint(freePorts[1]) + "-:443" + + hostFwdPrefix + fmt.Sprint(freePorts[2]) + "-:22", } *qemuArgs = append(*qemuArgs, netNatDefault...) @@ -383,7 +385,7 @@ func setNetworkingArgs(qemuArgs *[]string) (bool, error) { netNat := []string{"-netdev", "user,id=net0", "-device", "e1000,netdev=net0"} for _, p := range ports { - netNat[1] += ",hostfwd=tcp::" + p + netNat[1] += hostFwdPrefix + p } *qemuArgs = append(*qemuArgs, netNat...) diff --git a/cmd/gom/cmd/version.go b/cmd/gom/cmd/version.go index e6b8722..7c8df31 100644 --- a/cmd/gom/cmd/version.go +++ b/cmd/gom/cmd/version.go @@ -14,7 +14,7 @@ var versionCmd = &cobra.Command{ Use: "version", Short: "returns the version of the program", Long: `returns the version of the program`, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { return versionImpl.version() }, } diff --git a/internal/oci/pull.go b/internal/oci/pull.go index 6f61162..8eacfab 100644 --- a/internal/oci/pull.go +++ b/internal/oci/pull.go @@ -35,7 +35,7 @@ func Pull(ctx context.Context, image string, username string, password string, o // Setup the client credentials. repo.Client = &auth.Client{ - Credential: func(ctx context.Context, reg string) (auth.Credential, error) { + Credential: func(_ context.Context, _ string) (auth.Credential, error) { return auth.Credential{ Username: username, Password: password,