volcano-sh / volcano

A Cloud Native Batch System (Project under CNCF)
https://volcano.sh
Apache License 2.0
4.24k stars 971 forks source link

chore: Replace deprecation `ioutil` fucntions and add depguard rules in `.golangci.yml` #3808

Open dongjiang1989 opened 2 weeks ago

dongjiang1989 commented 2 weeks ago
  1. Go 1.16 deprecated several io/ioutil functions.

ioutil.ReadFile -> os.ReadFile

ref: https://pkg.go.dev/io/ioutil

  1. Add depguard rules in .golangci.yml

  2. fix golangci-lint warning

    $ ./hack/verify-golangci-lint.sh
    checking whether golangci-lint has been installed
    installing golangci-lint .
    golangci/golangci-lint info checking GitHub for tag 'v1.54.2'
    golangci/golangci-lint info found version: 1.54.2 for v1.54.2/linux/amd64
    golangci/golangci-lint info installed /home/runner/work/volcano-sh/volcano/bin/golangci-lint
    begin run golangci-lint
    level=info msg="[config_reader] Config search paths: [./ /home/runner/work/volcano/volcano/src/github.com/volcano-sh/volcano /home/runner/work/volcano/volcano/src/github.com/volcano-sh /home/runner/work/volcano/volcano/src/github.com /home/runner/work/volcano/volcano/src /home/runner/work/volcano/volcano /home/runner/work/volcano /home/runner/work /home/runner /home /]"
    level=info msg="[config_reader] Used config file .golangci.yml"
    level=info msg="[lintersdb] Active [11](https://github.com/volcano-sh/volcano/actions/runs/11738190031/job/32700238716#step:5:12) linters: [deadcode depguard gofmt goimports gosimple govet ineffassign staticcheck unused varcheck whitespace]"
    level=info msg="[loader] Go packages loading at mode 575 (deps|exports_file|files|imports|name|compiled_files|types_sizes) took 2m[15](https://github.com/volcano-sh/volcano/actions/runs/11738190031/job/32700238716#step:5:16).339428093s"
    level=warning msg="[runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused."
    level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused."
    ....
volcano-sh-bot commented 2 weeks ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign hwdef You can assign the PR to them by writing /assign @hwdef in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/volcano-sh/volcano/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
dongjiang1989 commented 2 weeks ago

Thanks @hwdef Please re-check it

hwdef commented 2 weeks ago

Please fix the CI

dongjiang1989 commented 2 weeks ago

Please fix the CI

Hmmm....🤔️ Maybe main branch CI pipeline fail ...

ref: https://github.com/volcano-sh/volcano/actions/runs/11714749109/job/32629965063 https://github.com/volcano-sh/volcano/actions/runs/11714749102/job/32629965564 https://github.com/volcano-sh/volcano/actions/runs/11714749120/job/32629965207

JesseStutler commented 1 week ago

Please rebase the new master branch because CI has been fixed: https://github.com/volcano-sh/volcano/pull/3817

dongjiang1989 commented 1 week ago

Please rebase the new master branch because CI has been fixed: #3817

Great! @JesseStutler . thanks.

dongjiang1989 commented 1 week ago

/assign @hwdef

hwdef commented 4 days ago

@lowang-bh @Monokaix Please take a look

volcano-sh-bot commented 1 day ago

New changes are detected. LGTM label has been removed.