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

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")
}
主站蜘蛛池模板: 靖西县| 平利县| 大荔县| 施甸县| 龙岩市| 乌鲁木齐市| 曲松县| 微山县| 青海省| 沭阳县| 义马市| 贡嘎县| 阿合奇县| 博罗县| 介休市| 荆门市| 吉安县| 石渠县| 太原市| 泰和县| 济南市| 荥经县| 太白县| 绿春县| 扶余县| 深州市| 洪洞县| 朝阳区| 镇宁| 台中县| 筠连县| 东乌| 耿马| 临沧市| 揭西县| 广州市| 怀远县| 澳门| 全椒县| 汽车| 龙川县|