TernAry is a simple, lightweight, and easy-to-use function to implement a ternary statement.
package main
import (
"fmt"
"github.com/karim-w/tern"
)
func main() {
a := 1
b := 2
fmt.Println(tern.Ary(a > b, a, b))
}
BSD 3-Clause License
karim-w
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.