Go's standard library has a slices package with a function called Backward. It lets you iterate over the elements of a slice in reverse order: // Backward returns an iterator over index-value pairs in the slice, // traversing it backward with descending indices.