package
Version:
v1.3.9
Opens a new window with list of versions in this module.
Published: Oct 28, 2024
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
func Get[T any](arr []T, index int) T
Get 从给定的数组中获取指定索引的元素。
如果索引在数组的有效范围内,则返回该索引处的元素;
否则,返回该类型的零值。
参数:
arr []T - 任意类型的切片。
index int - 要获取元素的索引。
返回值:
T - 索引处的元素或该类型的零值。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.