Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump lint #2

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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
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