The fmt package can do this for you:

fmt.Printf("|%06d|%6d|\n", 12, 345)

Notice the 0 in %06d, that will make it a width of 6 and pad it with zeros. The second one will pad with spaces.

You can see it in action here: http://play.golang.org/p/cinDspMccp