diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index cf8e8c9..281063e 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -14,13 +14,10 @@ jobs: name: lint runs-on: ubuntu-latest steps: - + - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.19 - - - uses: actions/checkout@v3 - + go-version: '1.21' - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: 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,