Skip to content

Instantly share code, notes, and snippets.

View mg98's full-sized avatar
🪄

Marcel Gregoriadis mg98

🪄
View GitHub Profile
@mg98
mg98 / set.go
Last active January 27, 2023 16:54
Implementation of a generic Set type in Go (1.18+)
// Set is a collection of unique values.
type Set[T comparable] struct {
elements map[T]bool
}
// NewSet creates a new empty set.
func NewSet[T comparable]() *Set[T] {
return &Set[T]{elements: map[T]bool{}}
}
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 31, 2024 01:21
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example