Original post

package main

import (
        "fmt"
)

func move(n int, source, target, auxiliary []int) {
        if n > 0 {
                move(n-1, source, auxiliary, target)
                curr := source[len(source)-1]
                target = append(target, curr)
                source = source[:len(source)-1]

                fmt.Printf("%vn%vn%vn", source, auxiliary, target)

                move(n-1, auxiliary, target, source)
        }
}

func main() {
        var (
                a = []int{3, 2, 1}
                b = []int{}
                c = []int{}
        )
        move(3, a, c, b)
}