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 the interface{} type with the shorter any #630

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

enarha
Copy link
Contributor

@enarha enarha commented Oct 8, 2023

Go 1.18 includes the pre-declared identifier "any", which is a shorter alias of "interface{}". The following command was used to replace each instance of "interface{}" with "any" in the codebase excluding the vendor directory and auto generated protobuf files (.pb.go).
gofmt -r 'interface{} -> any' -w .

/kind misc

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you review them:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Tested your changes locally (if this is a code change)
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user-facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contain the string "action required" if the change requires additional action from users switching to the new release
NONE

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/misc Categorizes issue or PR as a miscellaneuous one. labels Oct 8, 2023
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 8, 2023
@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 10, 2023
@adambkaplan
Copy link
Contributor

/kind cleanup

@tekton-robot tekton-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Oct 10, 2023
Copy link
Member

@avinal avinal left a comment

Choose a reason for hiding this comment

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

I just have one concern, even though this is a cleanup. We should not edit the generated code. The rest of the changes are fine. Because if the proto files are edited, those code will get overwritten.

Do we want to patch the changes every time?

@enarha enarha force-pushed the replace-empty-interface-any branch from 9afbfb7 to d63fdee Compare October 17, 2023 07:49
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 17, 2023
@enarha
Copy link
Contributor Author

enarha commented Oct 17, 2023

@avinal good point. I updated the PR to exclude the .pb.go files as well (in addition to vendor/).

Go 1.18 includes the predeclared identifier "any", which is a shorter
alias of "interface{}". The following command was used to replace each
instance of "interface{}" with "any" in the codebase excluding the
vendor directory and auto generated protobuf files (.pb.go).
`gofmt -r 'interface{} -> any' -w .`
@enarha enarha force-pushed the replace-empty-interface-any branch from d63fdee to 9d244ae Compare October 17, 2023 07:55
Copy link
Member

@avinal avinal left a comment

Choose a reason for hiding this comment

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

Looks good to me
/approve

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: avinal, sayan-biswas

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:
  • OWNERS [avinal,sayan-biswas]

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

Copy link
Contributor

@khrm khrm left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 31, 2023
@tekton-robot tekton-robot merged commit 1ad89d2 into tektoncd:main Oct 31, 2023
6 checks passed
@enarha enarha deleted the replace-empty-interface-any branch October 31, 2023 12:47
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/misc Categorizes issue or PR as a miscellaneuous one. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants