内置函数

截止至go1.23,目前有18个内置函数!append(slice []Type, elems …Type) []Type

append(slice []Type, elems ...Type) []Type

注意

​ 仅用于切片类型变量追加元素。

elems为切片+...

elems为字符串+...

cap(v Type) int

clear[T ~[]Type | ~map[Type]Type1](t T)

close(c chan<- Type)

complex(r, i FloatType) ComplexType

copy(dst, src []Type) int

delete(m map[Type]Type1, key Type)

imag(c ComplexType) FloatType

len(v Type) int

make(t Type, size ...IntegerType) Type

max[T cmp.Ordered](x T, y ...T) T

min[T cmp.Ordered](x T, y ...T) T

new(Type) *Type

panic(v any)

print(args ...Type)

println(args ...Type)

real(c ComplexType) FloatType

recover() any

最后修改 October 10, 2024: 更新 (a4b8f85)