Skip to content

refactor: replace interface{} with any (Go 1.18+)#211

Closed
MD-Mushfiqur123 wants to merge 1 commit into
containerd:mainfrom
MD-Mushfiqur123:refactor/interface-to-any
Closed

refactor: replace interface{} with any (Go 1.18+)#211
MD-Mushfiqur123 wants to merge 1 commit into
containerd:mainfrom
MD-Mushfiqur123:refactor/interface-to-any

Conversation

@MD-Mushfiqur123

Copy link
Copy Markdown

Replace all occurrences of interface{} with any (introduced in Go 1.18) for modern Go idiom.

Files changed:

  • cmd/ctr/commands/commands.go
  • cmd/ctr/commands/containers/containers.go
  • cmd/ctr/commands/run/run_unix.go
  • cmd/ctr/commands/run/run_windows.go

@stefanberger

Copy link
Copy Markdown
Contributor

Thanks for doing this. What you are doing it part of a (possibly) bigger undertaking -- the ctr of this project needs to be sync'ed again with the codebase of the one from containerd. They also made those changes you are propopsing in your PR here as well.

containers.Container
Spec interface{} `json:"Spec,omitempty"`
Spec any `json:"Spec,omitempty"`
}{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You commit is missing a Signed-off-by.

@MD-Mushfiqur123

Copy link
Copy Markdown
Author

@stefanberger thanks for the review. You're right that the ctr here needs to stay in sync with containerd's upstream. Since the upstream already made these interface{}any changes, this PR can be closed in favor of a proper sync when that happens. Let me know if there's anything specific I should adjust in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants