官术网_书友最值得收藏!

goto

Go does have a goto statement, but it is very rarely used. Create a label with a name and a colon, then go to it using the goto keyword. Here is a basic example:

package main

import "fmt"

func main() {

goto customLabel

// Will never get executed because
// the goto statement will jump right
// past this line
fmt.Println("Hello")

customLabel:
fmt.Println("World")
}
主站蜘蛛池模板: 楚雄市| 疏勒县| 蒙阴县| 焦作市| 额济纳旗| 波密县| 沐川县| 垣曲县| 内丘县| 金昌市| 濮阳市| 青田县| 莱西市| 南江县| 达州市| 邯郸县| 正阳县| 松原市| 五常市| 六安市| 来凤县| 明光市| 米林县| 壶关县| 渭源县| 湖北省| 樟树市| 登封市| 太保市| 乐安县| 商水县| 白城市| 辽中县| 博湖县| 石台县| 嘉祥县| 柳州市| 乌审旗| 肇源县| 大石桥市| 柯坪县|