Use goto to jump to a labeled statement within the same function, but avoid it for general control flow as it often creates unreadable code.
for i := 0; i < 10; i++ {
if i == 5 {
goto end
}
fmt.Println(i)
}
end:
fmt.Println("Done")
Prefer structured alternatives like break, return, or helper functions to maintain clarity.