Skip to content

Commit

Permalink
test: fix golint
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhangx committed Feb 4, 2024
1 parent ef5d210 commit bf4e2b2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 47 deletions.
63 changes: 17 additions & 46 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,19 @@
name: golangci-lint
name: Static Checks
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read
pull_request: {}
push: {}
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.18
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.42.1

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
args: "--out-${NO_FUTURE}format colored-line-number --timeout=5m"

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true then the action will use pre-installed Go.
# skip-go-installation: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
- name: errors
run: golangci-lint run
if: ${{ failure() }}
go_lint:
name: Go Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: ^1.19
- uses: actions/checkout@master
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
args: -E=gofmt,unused,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,depguard,dogsled,durationcheck,errname,forbidigo -D=staticcheck --timeout=30m0s
2 changes: 1 addition & 1 deletion pkg/iscsilib/iscsiadm.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type Secrets struct {
func iscsiCmd(args ...string) (string, error) {
stdout, err := execWithTimeout("iscsiadm", args, time.Second*3)

klog.V(2).Infof("Run iscsiadm command: %s", strings.Join(append([]string{"iscsiadm"}, args...), " ")) // nolint
klog.V(2).Infof("Run iscsiadm command: %s", strings.Join(append([]string{"iscsiadm"}, args...), " ")) // nolint
iscsiadmDebug(string(stdout), err)

return string(stdout), err
Expand Down

0 comments on commit bf4e2b2

Please sign in to comment.