Goto
Go has a goto
statement - use it wisely. With goto
youjump to a label which must be defined within the current function.For instance, a loop in disguise:
func myfunc() {
i := 0
Here:
fmt.Println(i)
i++
goto Here
}
The string Here:
indicates a label. A label does not need to start witha capital letter and is case sensitive.
当前内容版权归 Miek Gieben 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Miek Gieben .