github.com/songzhibin97/go-baseutils@v0.0.2-0.20240302024150-487d8ce9c082/base/bternaryexpr/example_test.go (about)

     1  package bternaryexpr
     2  
     3  import "fmt"
     4  
     5  func ExampleTernaryExpr() {
     6  	fmt.Println(TernaryExpr(true, 1, 2))  // 1
     7  	fmt.Println(TernaryExpr(false, 1, 2)) // 2
     8  }