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

Update go version to v1.23 #251

Merged
merged 3 commits into from
Oct 30, 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
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"

- name: Run unit tests and coverage test
id: test-coverage
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/go-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"

- name: Install dependencies
run: |
go version
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
- name: Run Lint
run: |
golangci-lint run driver/...
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"

- name: Run fmt
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"
-
name: Docker Login
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.22
- name: Set up Go 1.23
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"
id: go

- name: Check out code into the Go module directory
Expand Down
21 changes: 8 additions & 13 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
linters-settings:
dupl:
threshold: 100
threshold: 300
funlen:
lines: -1 # the number of lines (code + empty lines) is not a right metric and leads to code without empty line or one-liner.
statements: 50
Expand All @@ -23,7 +23,7 @@ linters-settings:
min-complexity: 15
goimports:
local-prefixes: github.com/golangci/golangci-lint
gomnd:
mnd:
# don't include the "operation" and "assign"
checks:
- argument
Expand All @@ -37,9 +37,7 @@ linters-settings:
- '3'
ignored-functions:
- strings.SplitN

govet:
check-shadowing: true
settings:
printf:
funcs:
Expand All @@ -48,7 +46,7 @@ linters-settings:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
lll:
line-length: 140
line-length: 150
misspell:
locale: US
nolintlint:
Expand All @@ -59,23 +57,17 @@ linters-settings:
rules:
- name: unexported-return
disabled: true

linters:
disable-all: true
enable:
- bodyclose
- dogsled
- dupl
- errcheck
- exportloopref
- funlen
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- gomnd
- mnd
- goprintffuncname
- gosec
- gosimple
Expand All @@ -96,11 +88,13 @@ linters:
- whitespace

# don't enable:
# - bodyclose
# - depguard
# - asciicheck
# - scopelint
# - gochecknoglobals
# - gocognit
# - gocritic
# - godot
# - godox
# - goerr113
Expand All @@ -122,6 +116,7 @@ issues:
exclude:
- abcdef
- G204
- G115
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
Expand All @@ -132,4 +127,4 @@ issues:
- gosec

run:
timeout: 5m
timeout: 5m
2 changes: 1 addition & 1 deletion driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (c *VultrControllerServer) CreateVolume(ctx context.Context, req *csi.Creat
return nil, status.Error(codes.InvalidArgument, "CreateVolume Name is missing")
}

if req.VolumeCapabilities == nil || len(req.VolumeCapabilities) == 0 {
if len(req.VolumeCapabilities) == 0 {
return nil, status.Error(codes.InvalidArgument, "CreateVolume Volume Capabilities is missing")
}

Expand Down
4 changes: 2 additions & 2 deletions driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (n *VultrNodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStag
}

// NodeUnstageVolume provides the node volume unstage functionality
func (n *VultrNodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) { //nolint:dupl,lll
func (n *VultrNodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error) {
if req.VolumeId == "" {
return nil, status.Error(codes.InvalidArgument, "VolumeID must be provided")
}
Expand Down Expand Up @@ -197,7 +197,7 @@ func (n *VultrNodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePu
}

// NodeUnpublishVolume allows the volume to be unpublished
func (n *VultrNodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error) { //nolint:dupl,lll
func (n *VultrNodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error) {
if req.VolumeId == "" {
return nil, status.Error(codes.InvalidArgument, "VolumeID must be provided")
}
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/vultr/vultr-csi

go 1.22

toolchain go1.22.7
go 1.23

require (
github.com/container-storage-interface/spec v1.10.0
Expand Down
Loading