MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / Ternary

Function Ternary

utils/operator.go:49–54  ·  view source on GitHub ↗
(condition bool, trueValue, falseValue T)

Source from the content-addressed store, hash-verified

47}
48
49func Ternary[T any](condition bool, trueValue, falseValue T) T {
50 if condition {
51 return trueValue
52 }
53 return falseValue
54}
55
56func LazyTernary[T any](condition bool, trueFunc, falseFunc func() T) T {
57 if condition {

Callers 2

BuildMultiMsgUploadReqFunction · 0.92
ParseMessageElementsFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected