Multiple input checks, repeat if conditions are not met I've used this code to make some inputs checks. On any failed check, I need to ask again for proper input. I used labels and goto to achieve this, which they seem to be disliked by programmers as a concept.
How could I achieve the same effect without labels/goto? I considered putting all this code in a function and calling itself from inside, but it repeated only once for some reason - didn't keep asking if kept getting wrong answers.
// 0 exits
var f float64
var n int
startGame := func() {
reception:
    fmt.Println()
    fmt.Print(`Give number (1-9): `)
    _, err := fmt.Scan(&amp;f)

    // check letters or symbols
    if err != nil {
        fmt.Println(&quot;Letters or symbols not accepted&quot;)
        goto reception
    }

    // exit
    if f == 0 {
        os.Exit(0)
    }

    // check for integers only
    if f &lt; 1 || f &gt; 9 || f-math.Ceil(f) != 0 {
        fmt.Println(&quot;Only integer numbers between 1-9 are accepted&quot;)
        goto reception
    }

    n = int(f)
    // check for empty cells
    if myArray[n-1] == false {
        fmt.Println(&quot;Empty cell&quot;, n)
        goto reception
    }
}
for {} (for loop without condition) loops forever until break.

Put the contents of the function in a for {}.
Remove the label and replace goto reception with continue. This will cause the current iteration of the loop to end and execution will continue with another iteration, starting from the top of the block.
Use break at the end to exit the for loop