Skip to content

Conversation

kevwan
Copy link
Owner

@kevwan kevwan commented Jan 6, 2022

No description provided.

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

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

// 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

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

Is there anything preventing this PR from being merged?

@kevwan
Copy link
Owner Author

kevwan commented Apr 18, 2022

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