It is legal and idiomatic to swap values of two variables using "tuple assignment" instead of swapping them in multiple statements.
For Python, "tuple assignment" is a feature that allows a tuple of variables on the left of an assignment to be assigned values from a tuple on the right of the assignment. A similar assignment approach works for Go as well.
tmp := *x
*x = *y
*y = tmp
*x, *y = *y, *x