package
Version:
v0.6.2
Opens a new window with list of versions in this module.
Published: Feb 3, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
func Where[T StatType](condition []T, x, y []T) []T
Where 返回根据“条件”从“x”或“y”中选择的元素
这里先实现一个简单的, 留给于总重构
params只支持两个默认值x和y, 如果condition为true返回x, 否则返回y
condition和param都可能是基础数据类型,也可能是一个slice, 并且长度可能不一致
直接写成序列版本, 可能更简单
Source Files
¶
Click to show internal directories.
Click to hide internal directories.