Skip to content

feat: implement the version with generics#1

Draft
kevwan wants to merge 2 commits into
mainfrom
feature/generics
Draft

feat: implement the version with generics#1
kevwan wants to merge 2 commits into
mainfrom
feature/generics

Conversation

@kevwan

@kevwan kevwan commented Jan 6, 2022

Copy link
Copy Markdown
Owner

No description provided.

@kevwan kevwan marked this pull request as draft January 6, 2022 10:35
Comment thread ring.go
// A Ring can be used as fixed size ring.
type Ring struct {
elements []interface{}
type Ring[T any] struct {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚫 [staticcheck] <compile> reported by reviewdog 🐶
expected ']', found any

Comment thread ring.go
// NewRing returns a Ring object with the given size n.
func NewRing(n int) *Ring {
func NewRing[T any](n int) *Ring[T] {
if n < 1 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚫 [staticcheck] <compile> reported by reviewdog 🐶
expected declaration, found 'if'

@kevwan kevwan linked an issue Jan 6, 2022 that may be closed by this pull request
@NicklasWallgren

Copy link
Copy Markdown

Is there anything preventing this PR from being merged?

@kevwan

kevwan commented Apr 18, 2022

Copy link
Copy Markdown
Owner Author

Is there anything preventing this PR from being merged?

Yes, go template doesn't support template method yet. Waiting for future releases.

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.

Proposal: implement the version with generics.

3 participants