import ( "fmt" "os" ) func main() { for i :=0;i<30;i++{ for j:=0;j<30;j++{ if i ==10&&j==3 { goto exit } } } exit: fmt.Println("exit") os.Exit(-1) }
输出:
exit
Process finished with exit code -1
import ( "fmt" "os" ) func main() { for i :=0;i<30;i++{ for j:=0;j<30;j++{ if i ==10&&j==3 { goto exit } } } exit: fmt.Println("exit") os.Exit(-1) }
输出:
exit
Process finished with exit code -1