# goto proc

Source: https://ref.dm-lang.org/proc/goto

### Format
> `goto node`

Jump to the specified node in the current proc.

```dm /goto/
goto End
world << "ERR"
End
world << "The end"
```

This displays "The end".

> [!note]
> 
> `goto` should be used judiciously. It's easy to fall into the trap of "spaghetti logic" where `goto` is relied on so much that it becomes too difficult to follow how the flow of code execution will proceed. Normally, you'll want to use a construct like `while()` or `for()` loops, and `break` and `continue` statements. `goto` is for more complex situations that aren't readily handled by any of these.

### See also
- [break statement](https://ref.dm-lang.org/proc/break.md)
- [continue statement](https://ref.dm-lang.org/proc/continue.md)
- [do proc](https://ref.dm-lang.org/proc/do.md)
- [for loop proc](https://ref.dm-lang.org/proc/for/loop.md)
- [for list proc](https://ref.dm-lang.org/proc/for/list.md)
- [while proc](https://ref.dm-lang.org/proc/while.md)
