来自 Nodejs,我可以做类似的事情:
// given an array `list` of objects with a field `fruit`:
fruits = list.map(el => el.fruit) # which will return an array of fruit strings
有什么办法可以在 golang 的优雅单衬里做到这一点?
我知道我可以用一个范围循环来做到这一点,但我正在寻找一个线性解决方案的可能性
慕运维8079593
相关分类