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

Replace all occurences of interface{} whith any #9792

Merged

Conversation

majst01
Copy link
Contributor

@majst01 majst01 commented May 19, 2024

How to categorize this PR?

/area dev-productivity
/kind cleanup

What this PR does / why we need it:

With go-1.18 interface{} was replaced with a type-alias to any to enhance readability see https://pkg.go.dev/builtin#any

With this all occurrences in the codebase, except the generated and third-party code was modified to use any now.

This was done with:

gofmt -r 'interface{} -> any' -w *.go

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

NONE

@gardener-prow gardener-prow bot added area/dev-productivity Developer productivity related (how to improve development) kind/cleanup Something that is not needed anymore and can be cleaned up cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 19, 2024
Copy link
Contributor

gardener-prow bot commented May 19, 2024

Hi @majst01. Thanks for your PR.

I'm waiting for a gardener member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@gardener-prow gardener-prow bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 19, 2024
@gardener-prow gardener-prow bot requested review from acumino and ScheererJ May 19, 2024 07:35
@majst01 majst01 force-pushed the replace-interface-with-any branch from 722dcf6 to 746410c Compare May 19, 2024 07:36
@shafeeqes
Copy link
Contributor

/ok-to-test

@gardener-prow gardener-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 20, 2024
@majst01
Copy link
Contributor Author

majst01 commented May 20, 2024

/test pull-gardener-e2e-kind

@majst01
Copy link
Contributor Author

majst01 commented May 20, 2024

/retest

@Kostov6
Copy link
Contributor

Kostov6 commented May 20, 2024

If we are going to stick with this alias what about adding a script in a Make target (example format) that checks for/replaces interface{} so that there are no interface{} added in future PR's? On the other side is it worth the effort for just a little bit of bonus code consistency?

@majst01
Copy link
Contributor Author

majst01 commented May 20, 2024

If we are going to stick with this alias what about adding a script in a Make target (example format) that checks for/replaces interface{} so that there are no interface{} added in future PR's? On the other side is it worth the effort for just a little bit of bonus code consistency?

Can easily be done with golangci-lint, see Example

@rfranzke
Copy link
Member

@majst01 Do you want to augment https://github.com/gardener/gardener/blob/master/.golangci.yaml.in accordingly?

@majst01 majst01 force-pushed the replace-interface-with-any branch from 746410c to 66ec6a6 Compare May 21, 2024 09:33
@majst01
Copy link
Contributor Author

majst01 commented May 21, 2024

@majst01 Do you want to augment https://github.com/gardener/gardener/blob/master/.golangci.yaml.in accordingly?

done

Copy link
Member

@rfranzke rfranzke left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label May 21, 2024
Copy link
Contributor

gardener-prow bot commented May 21, 2024

LGTM label has been added.

Git tree hash: c0afecdc842fff30907d468b4d1bd42290133bcf

Copy link
Contributor

gardener-prow bot commented May 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rfranzke

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

The pull request process is described 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

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 21, 2024
@majst01
Copy link
Contributor Author

majst01 commented May 21, 2024

/retest

@gardener-prow gardener-prow bot merged commit 6ba5765 into gardener:master May 21, 2024
18 checks passed
@majst01 majst01 deleted the replace-interface-with-any branch May 22, 2024 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/dev-productivity Developer productivity related (how to improve development) cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/cleanup Something that is not needed anymore and can be cleaned up lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants