Documentation
¶
Overview ¶
Package tern: Flexible tern operation engine to support Go with condition-based evaluation Provides comprehensive tern operations with bool/function conditions and value/function arguments Features both tern operations (condition ? a : b) and two-value operations (condition ? a : zero) Supports deferred evaluation through function parameters to avoid unneeded computation
tern: Go 的灵活三元运算引擎,支持条件评估 提供全面的三元运算,支持布尔/函数条件和值/函数参数 包含三元运算(条件 ? a : b)和二元运算(条件 ? a : 零值) 通过函数参数支持惰性求值,避免不必要的计算
Index ¶
- func BF[T any](condition bool, a func() T) T
- func BFF[T any](condition bool, a func() T, b func() T) T
- func BFV[T any](condition bool, a func() T, b T) T
- func BV[T any](condition bool, a T) T
- func BVF[T any](condition bool, a T, b func() T) T
- func BVV[T any](condition bool, a, b T) T
- func FF[T any](condition func() bool, a func() T) T
- func FFF[T any](condition func() bool, a func() T, b func() T) T
- func FFV[T any](condition func() bool, a func() T, b T) T
- func FV[T any](condition func() bool, a T) T
- func FVF[T any](condition func() bool, a T, b func() T) T
- func FVV[T any](condition func() bool, a, b T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BF ¶
BF returns a() if condition is true, otherwise returns zero value BF 如果 condition 为 true 则返回 a(),否则返回零值
func BFF ¶
BFF returns a() if condition is true, otherwise returns b() BFF 如果 condition 为 true 则返回 a(),否则返回 b()
func BFV ¶
BFV returns a() if condition is true, otherwise returns b BFV 如果 condition 为 true 则返回 a(),否则返回 b
func BV ¶
BV returns a if condition is true, otherwise returns zero value BV 如果 condition 为 true 则返回 a,否则返回零值
func BVF ¶
BVF returns a if condition is true, otherwise calls and returns b() BVF 如果 condition 为 true 则返回 a,否则调用并返回 b()
func BVV ¶
BVV returns a if condition is true, otherwise returns b BVV 如果 condition 为 true 则返回 a,否则返回 b
func FF ¶
FF returns a() if condition() is true, otherwise returns zero value FF 如果 condition() 为 true 则返回 a(),否则返回零值
func FFF ¶
FFF returns a() if condition() is true, otherwise returns b() FFF 如果 condition() 为 true 则返回 a(),否则返回 b()
func FFV ¶
FFV returns a() if condition() is true, otherwise returns b FFV 如果 condition() 为 true 则返回 a(),否则返回 b
func FV ¶
FV returns a if condition() is true, otherwise returns zero value FV 如果 condition() 为 true 则返回 a,否则返回零值
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
demos/demo1x
command
|
|
|
demos/demo2x
command
|
|
|
demos/demo3x
command
|
|
|
demos/demo4x
command
|
|
|
Package nulltern: Safe tern operation engine to support reference value handling Provides comprehensive tern operations based on nil reference checks Features each combination of reference/function parameters with efficient nil-safe evaluation Supports both direct reference values and function-based reference generation with deferred evaluation
|
Package nulltern: Safe tern operation engine to support reference value handling Provides comprehensive tern operations based on nil reference checks Features each combination of reference/function parameters with efficient nil-safe evaluation Supports both direct reference values and function-based reference generation with deferred evaluation |
|
Package sametern: Match-based tern operation engine with flexible value matching Provides comprehensive tern operations based on matching comparisons Features each combination of value/function parameters to support first argument, match condition, and result Supports both constant and dynamic matching with efficient evaluation patterns
|
Package sametern: Match-based tern operation engine with flexible value matching Provides comprehensive tern operations based on matching comparisons Features each combination of value/function parameters to support first argument, match condition, and result Supports both constant and dynamic matching with efficient evaluation patterns |
|
Package slicetern provides safe accessors for slice elements.
|
Package slicetern provides safe accessors for slice elements. |
|
Package zerotern: Zero-value aware tern operation engine with type-safe evaluation Provides comprehensive tern operations based on zero-value comparisons to support comparable types Features each combination of value/function parameters with efficient zero-value detection Supports both direct value comparison and function-based value generation with deferred evaluation
|
Package zerotern: Zero-value aware tern operation engine with type-safe evaluation Provides comprehensive tern operations based on zero-value comparisons to support comparable types Features each combination of value/function parameters with efficient zero-value detection Supports both direct value comparison and function-based value generation with deferred evaluation |