function

package
v0.0.0-...-9d91cd3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const LIM = 41

LIM 限制

Variables

This section is empty.

Functions

func Test1

func Test1()

Test1 递归

func Test2

func Test2()

Test2 回调 。 函数可以作为其它函数的参数进行传递,然后在其它函数内调用执行,一般称之为回调。

func Test3

func Test3()

Test3 闭包 匿名函数同样被称之为闭包(函数式语言的术语):它们被允许调用定义在其它环境下的变量。 闭包可使得某个函数捕捉到一些外部状态,例如: 函数被创建时的状态。另一种表示方式为:一个闭包继承了函数所声明时的作用域。 这种状态(作用域内的变量)都被共享到闭包的环境中,因此这些变量可以在闭包中被操作,直到被销毁

判断一段代码的执行时间 用 time 包

func Test4

func Test4()

Test4 使用内存缓存

func Test5

func Test5()

Test5 变长参数 在传递过程中应该传递 切片的 slice... 形式。

实际上变长参数的形式是 []type 形式

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL