github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/goto6.gno (about)

     1  package main
     2  
     3  func main() {
     4  	for {
     5  		goto here
     6  	nowhere:
     7  		panic("should not happen")
     8  	there:
     9  		println("there")
    10  		return
    11  	here:
    12  		println("here")
    13  		switch 1 {
    14  		case 1:
    15  			goto there
    16  		default:
    17  			panic("should not happen")
    18  		}
    19  	}
    20  }
    21  
    22  // Output:
    23  // here
    24  // there