From 8f18cbe20eefdcaaa7c0ceca1c07c2ac1ef936d4 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 | 13 +++++-------- cmd/gom/cmd/play.go | 10 ++++++---- cmd/gom/cmd/version.go | 2 +- go.mod | 4 +++- internal/oci/pull.go | 2 +- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index cf8e8c9..9044d1c 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -14,14 +14,11 @@ 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.56.2 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/go.mod b/go.mod index 36015e4..94639c7 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/damdo/gokrazy-machine -go 1.19 +go 1.21 + +toolchain go1.22.2 require ( github.com/CalebQ42/squashfs v0.8.4 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,