Skip to content

Commit

Permalink
bump lint
Browse files Browse the repository at this point in the history
  • Loading branch information
damdo committed Jul 1, 2024
1 parent 8162bcc commit 6832105
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 6 additions & 4 deletions cmd/gom/cmd/play.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
"github.com/spf13/cobra"
)

const hostFwdPrefix = ",hostfwd=tcp::"

// playCmd is gom play.
var playCmd = &cobra.Command{
Use: "play",
Expand Down Expand Up @@ -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...)
Expand All @@ -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...)
Expand Down
2 changes: 1 addition & 1 deletion cmd/gom/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
},
}
Expand Down
2 changes: 1 addition & 1 deletion internal/oci/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6832105

Please sign in to comment.