Simple code recursion and tails
package main
import "fmt"
func TailRecursive(number int, product int) int {
product = product + number
if number == 1 {
return product
}
return TailRecursive(number-1, product)
}
func main() {
answer := TailRecursive(5, 0)
fmt.Printf("Recursive: %d
", answer)
}
When I try tool compile
go tool compile 6g -S ./g9.go > assembly.asm
I got this
cat assembly.asm
6g:0:0: open 6g: no such file or directory
My kernel architecture
x86_64 x86_64 x86_64 GNU/Linux
How to use go tool compile to get the proper assembly output?