Multiple Return Values
XGo has built-in support for multiple return values. This feature is used often in idiomatic XGo, for example to return both result and error values from a function.
The (int, int)
in this function signature shows that
the function returns 2 int
s.
Here we use the 2 different return values from the call with multiple assignment.
If you only want a subset of the returned values,
use the blank identifier _
.
Next example: Errors