Keyword

Go goto keyword

Transfers control to a label in the same function. It cannot jump into a block from outside or skip variable declarations that would bring new variables into scope. Prefer structured control flow when it is clearer. Example prints ready.

Formal Syntax & Structure

go syntaxgo
goto Label

Working Example

Example Snippetgo
package main
import "fmt"
func main() {  goto ReadyReady:  fmt.Println("ready")}
Go Reference