Skip to content

Instantly share code, notes, and snippets.

View dilmurodov's full-sized avatar
🎯
Focusing

Dilmurodov Tolibbek dilmurodov

🎯
Focusing
  • Alif Uzbekistan
  • Ташкент, Мирабад
View GitHub Profile
@abdivasiyev
abdivasiyev / ternary.go
Created June 28, 2023 14:40
Simple ternary operator implementation in Go with generics
package ternary
type operatorIf[T comparable] struct {
condition bool
value T
elseIf *operatorIf[T]
elseValue T
}
func If[T comparable](condition bool) *operatorIf[T] {