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

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dongjiang1989
Copy link
Contributor

@dongjiang1989 dongjiang1989 commented Nov 8, 2024

  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."
....

Signed-off-by: dongjiang1989 <[email protected]>
@volcano-sh-bot volcano-sh-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 8, 2024
Copy link
Member

@hwdef hwdef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2024
Signed-off-by: dongjiang1989 <[email protected]>
@volcano-sh-bot volcano-sh-bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2024
@volcano-sh-bot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@volcano-sh-bot
Copy link
Contributor

[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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 8, 2024
@dongjiang1989
Copy link
Contributor Author

Thanks @hwdef Please re-check it

@hwdef
Copy link
Member

hwdef commented Nov 8, 2024

Please fix the CI

@dongjiang1989
Copy link
Contributor Author

dongjiang1989 commented Nov 8, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants