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

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")
}
主站蜘蛛池模板: 涟水县| 仪征市| 镇江市| 宝兴县| 绥宁县| 祁门县| 阳曲县| 息烽县| 奉化市| 临洮县| 兴山县| 邹平县| 湾仔区| 高安市| 琼海市| 吉木萨尔县| 天水市| 蓬安县| 长治县| 来凤县| 旅游| 上饶县| 黑水县| 柯坪县| 蛟河市| 江西省| 南宫市| 西峡县| 潼南县| 隆回县| 宜丰县| 宁安市| 峡江县| 梁山县| 东台市| 巴彦淖尔市| 寿光市| 太和县| 满洲里市| 高阳县| 平乡县|