Package Golang with ternary operator
This package can be installed with the go get command:
go get github.com/arteev/tern
Example:
package main
import (
"fmt"
"github.com/arteev/tern"
)
func main() {
fmt.Println(tern.Op(true,"It's good:)","Oh how bad"))
}
package main
import (
"fmt"
"github.com/arteev/tern"
)
func main() {
fmt.Println(tern.Decode(0,-1,"less",1,"great","zero"))
}
MIT
Arteev Aleksey