Skip to content

Commit

Permalink
tools: Update to golangci-lint v1.56.1
Browse files Browse the repository at this point in the history
This forces to set the go version to 1.21 in tools/go.mod:
```
$ go mod tidy -go=1.20 -compat=1.20
go: github.com/GaijinEntertainment/go-exhaustruct/[email protected] requires [email protected], but 1.20 is requested
```

This commit also fixes these new warnings:
```
test/vm_test.go:180:19: unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
		createDev: func(t *testing.T) (config.VirtioDevice, error) {
		                ^
test/vm_test.go:194:19: unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
		createDev: func(t *testing.T) (config.VirtioDevice, error) {
		                ^
test/vm_test.go:201:19: unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
		createDev: func(t *testing.T) (config.VirtioDevice, error) {
		                ^
cmd/vfkit/root.go:19:13: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive)
	RunE: func(cmd *cobra.Command, args []string) error {
	           ^
pkg/vf/vsock.go:61:21: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
		DialContext: func(ctx context.Context, network, addr string) (conn net.Conn, e error) {
		                  ^
pkg/vf/vsock.go:106:42: unused-parameter: parameter 'network' seems to be unused, consider removing or renaming it as _ (revive)
		DialContext: func(ctx context.Context, network, addr string) (conn net.Conn, e error) {
		                                       ^
make: *** [lint] Error 1
```
  • Loading branch information
cfergeau committed Feb 12, 2024
1 parent 680b927 commit 8a96f18
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 197 deletions.
2 changes: 1 addition & 1 deletion cmd/vfkit/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var rootCmd = &cobra.Command{
Short: "vfkit is a simple hypervisor using Apple's virtualization framework",
Long: `A hypervisor written in Go using Apple's virtualization framework to run linux virtual machines.
Complete documentation is available at https://github.com/crc-org/vfkit`,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
if len(opts.LogLevel) > 0 {
ll, err := getLogLevel()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/vf/vsock.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func connectVsock(vm *vz.VirtualMachine, port uint, vsockPath string) (io.Closer
proxy.AddRoute(fmt.Sprintf("unix://:%s", vsockPath), &tcpproxy.DialProxy{
Addr: fmt.Sprintf("vsock:%d", port),
// when there's a connection to the unix socket listener, connect to the specified vsock port
DialContext: func(ctx context.Context, network, addr string) (conn net.Conn, e error) {
DialContext: func(_ context.Context, _, addr string) (conn net.Conn, e error) {
parsed, err := url.Parse(addr)
if err != nil {
return nil, err
Expand Down Expand Up @@ -103,7 +103,7 @@ func listenVsock(vm *vz.VirtualMachine, port uint, vsockPath string) (io.Closer,
proxy.AddRoute(fmt.Sprintf("vsock://:%d", port), &tcpproxy.DialProxy{
Addr: fmt.Sprintf("unix:%s", vsockPath),
// when there's a connection to the vsock listener, connect to the provided unix socket
DialContext: func(ctx context.Context, network, addr string) (conn net.Conn, e error) {
DialContext: func(ctx context.Context, _, addr string) (conn net.Conn, e error) {
parsed, err := url.Parse(addr)
if err != nil {
return nil, err
Expand Down
12 changes: 6 additions & 6 deletions test/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ var pciidTests = map[string]pciidTest{
"virtio-net": {
vendorID: 0x1af4, // Red Hat
deviceID: 0x1041,
createDev: func(t *testing.T) (config.VirtioDevice, error) {
createDev: func(_ *testing.T) (config.VirtioDevice, error) {
return config.VirtioNetNew("")
},
},
Expand All @@ -191,14 +191,14 @@ var pciidTests = map[string]pciidTest{
"virtio-rng": {
vendorID: 0x1af4, // Red Hat
deviceID: 0x1044,
createDev: func(t *testing.T) (config.VirtioDevice, error) {
createDev: func(_ *testing.T) (config.VirtioDevice, error) {
return config.VirtioRngNew()
},
},
"virtio-fs": {
vendorID: 0x1af4, // Red Hat
deviceID: 0x105a,
createDev: func(t *testing.T) (config.VirtioDevice, error) {
createDev: func(_ *testing.T) (config.VirtioDevice, error) {
return config.VirtioFsNew("./", "vfkit-share-test")
},
},
Expand All @@ -208,21 +208,21 @@ var pciidMacOS13Tests = map[string]pciidTest{
"virtio-gpu": {
vendorID: 0x1af4, // Red Hat
deviceID: 0x1050,
createDev: func(t *testing.T) (config.VirtioDevice, error) {
createDev: func(_ *testing.T) (config.VirtioDevice, error) {
return config.VirtioGPUNew()
},
},
"virtio-input/pointing-device": {
vendorID: 0x106b, // Apple
deviceID: 0x1a06,
createDev: func(t *testing.T) (config.VirtioDevice, error) {
createDev: func(_ *testing.T) (config.VirtioDevice, error) {
return config.VirtioInputNew("pointing")
},
},
"virtio-input/keyboard": {
vendorID: 0x106b, // Apple
deviceID: 0x1a06,
createDev: func(t *testing.T) (config.VirtioDevice, error) {
createDev: func(_ *testing.T) (config.VirtioDevice, error) {
return config.VirtioInputNew("keyboard")
},
},
Expand Down
88 changes: 45 additions & 43 deletions tools/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/crc-org/vfkit/tools

go 1.19
go 1.21

require github.com/golangci/golangci-lint v1.55.2
require github.com/golangci/golangci-lint v1.56.1

require (
4d63.com/gocheckcompilerdirectives v1.2.1 // indirect
Expand All @@ -11,13 +11,13 @@ require (
github.com/Abirdcfly/dupword v0.0.13 // indirect
github.com/Antonboom/errname v0.1.12 // indirect
github.com/Antonboom/nilnil v0.1.7 // indirect
github.com/Antonboom/testifylint v0.2.3 // indirect
github.com/Antonboom/testifylint v1.1.1 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0 // indirect
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/OpenPeeDeeP/depguard/v2 v2.1.0 // indirect
github.com/alecthomas/go-check-sumtype v0.1.3 // indirect
github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect
github.com/alecthomas/go-check-sumtype v0.1.4 // indirect
github.com/alexkohler/nakedret/v2 v2.0.2 // indirect
github.com/alexkohler/prealloc v1.0.0 // indirect
github.com/alingse/asasalint v0.0.11 // indirect
Expand All @@ -26,40 +26,41 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bkielbasa/cyclop v1.2.1 // indirect
github.com/blizzy78/varnamelen v0.8.0 // indirect
github.com/bombsimon/wsl/v3 v3.4.0 // indirect
github.com/bombsimon/wsl/v4 v4.2.0 // indirect
github.com/breml/bidichk v0.2.7 // indirect
github.com/breml/errchkjson v0.3.6 // indirect
github.com/butuzov/ireturn v0.2.2 // indirect
github.com/butuzov/ireturn v0.3.0 // indirect
github.com/butuzov/mirror v1.1.0 // indirect
github.com/catenacyber/perfsprint v0.2.0 // indirect
github.com/catenacyber/perfsprint v0.6.0 // indirect
github.com/ccojocar/zxcvbn-go v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/charithe/durationcheck v0.0.10 // indirect
github.com/chavacava/garif v0.1.0 // indirect
github.com/curioswitch/go-reassign v0.2.0 // indirect
github.com/daixiang0/gci v0.11.2 // indirect
github.com/daixiang0/gci v0.12.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denis-tingaikin/go-header v0.4.3 // indirect
github.com/esimonov/ifshort v1.0.4 // indirect
github.com/ettle/strcase v0.1.1 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/ettle/strcase v0.2.0 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/firefart/nonamedreturns v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/fzipp/gocyclo v0.6.0 // indirect
github.com/ghostiam/protogetter v0.2.3 // indirect
github.com/go-critic/go-critic v0.9.0 // indirect
github.com/ghostiam/protogetter v0.3.4 // indirect
github.com/go-critic/go-critic v0.11.0 // indirect
github.com/go-toolsmith/astcast v1.1.0 // indirect
github.com/go-toolsmith/astcopy v1.1.0 // indirect
github.com/go-toolsmith/astequal v1.1.0 // indirect
github.com/go-toolsmith/astfmt v1.1.0 // indirect
github.com/go-toolsmith/astp v1.1.0 // indirect
github.com/go-toolsmith/strparse v1.1.0 // indirect
github.com/go-toolsmith/typep v1.1.0 // indirect
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect
github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect
Expand All @@ -70,54 +71,54 @@ require (
github.com/golangci/revgrep v0.5.2 // indirect
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601 // indirect
github.com/gordonklaus/ineffassign v0.1.0 // indirect
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
github.com/gostaticanalysis/comment v1.4.2 // indirect
github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect
github.com/gostaticanalysis/nilerr v0.1.1 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hexops/gotextdiff v1.0.3 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jgautheron/goconst v1.6.0 // indirect
github.com/jgautheron/goconst v1.7.0 // indirect
github.com/jingyugao/rowserrcheck v1.1.1 // indirect
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect
github.com/jjti/go-spancheck v0.5.2 // indirect
github.com/julz/importas v0.1.0 // indirect
github.com/kisielk/errcheck v1.6.3 // indirect
github.com/kisielk/errcheck v1.7.0 // indirect
github.com/kisielk/gotool v1.0.0 // indirect
github.com/kkHAIKE/contextcheck v1.1.4 // indirect
github.com/kulti/thelper v0.6.3 // indirect
github.com/kunwardeep/paralleltest v1.0.8 // indirect
github.com/kunwardeep/paralleltest v1.0.9 // indirect
github.com/kyoh86/exportloopref v0.1.11 // indirect
github.com/ldez/gomoddirectives v0.2.3 // indirect
github.com/ldez/tagliatelle v0.5.0 // indirect
github.com/leonklingele/grouper v1.1.1 // indirect
github.com/lufeee/execinquery v1.2.1 // indirect
github.com/macabu/inamedparam v0.1.2 // indirect
github.com/macabu/inamedparam v0.1.3 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/maratori/testableexamples v1.0.0 // indirect
github.com/maratori/testpackage v1.1.1 // indirect
github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mbilski/exhaustivestruct v1.2.0 // indirect
github.com/mgechev/revive v1.3.4 // indirect
github.com/mgechev/revive v1.3.7 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moricho/tparallel v0.3.1 // indirect
github.com/nakabonne/nestif v0.3.1 // indirect
github.com/nishanths/exhaustive v0.11.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/nishanths/exhaustive v0.12.0 // indirect
github.com/nishanths/predeclared v0.2.2 // indirect
github.com/nunnatsa/ginkgolinter v0.14.1 // indirect
github.com/nunnatsa/ginkgolinter v0.15.2 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/polyfloyd/go-errorlint v1.4.5 // indirect
github.com/polyfloyd/go-errorlint v1.4.8 // indirect
github.com/prometheus/client_golang v1.12.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
Expand All @@ -139,7 +140,7 @@ require (
github.com/sivchari/tenv v1.7.1 // indirect
github.com/sonatard/noctx v0.0.2 // indirect
github.com/sourcegraph/go-diff v0.7.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
Expand All @@ -152,38 +153,39 @@ require (
github.com/subosito/gotenv v1.4.1 // indirect
github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect
github.com/tdakkota/asciicheck v0.2.0 // indirect
github.com/tetafro/godot v1.4.15 // indirect
github.com/tetafro/godot v1.4.16 // indirect
github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect
github.com/timonwong/loggercheck v0.9.4 // indirect
github.com/tomarrell/wrapcheck/v2 v2.8.1 // indirect
github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect
github.com/ultraware/funlen v0.1.0 // indirect
github.com/ultraware/whitespace v0.0.5 // indirect
github.com/ultraware/whitespace v0.1.0 // indirect
github.com/uudashr/gocognit v1.1.2 // indirect
github.com/xen0n/gosmopolitan v1.2.2 // indirect
github.com/yagipy/maintidx v1.0.0 // indirect
github.com/yeya24/promlinter v0.2.0 // indirect
github.com/ykadowak/zerologlint v0.1.3 // indirect
github.com/ykadowak/zerologlint v0.1.5 // indirect
gitlab.com/bosi/decorder v0.4.1 // indirect
go-simpler.org/sloglint v0.1.2 // indirect
go.tmz.dev/musttag v0.7.2 // indirect
go-simpler.org/musttag v0.8.0 // indirect
go-simpler.org/sloglint v0.4.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect
golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/sync v0.4.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect
golang.org/x/exp/typeparams v0.0.0-20231219180239-dc181d75b848 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.17.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/tools v0.4.6 // indirect
mvdan.cc/gofumpt v0.5.0 // indirect
mvdan.cc/gofumpt v0.6.0 // indirect
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d // indirect
mvdan.cc/unparam v0.0.0-20240104100049-c549a3470d14 // indirect
)
Loading

0 comments on commit 8a96f18

Please sign in to comment.