I have this program written in Go:
package main
func add(a, b int) int {
return a + b
}
func main () {
add(1,2)
}
For curiosity's sake, I would like to see what this program looks like in assembly.
I found a couple of ways to output assembly instructions from a Go program, mainly:
go tool compile -S file.go > file.S
Or
go tool objdump executable > disassembly
But it seems like both of these produce totally different outputs.
How can I print out human-readable assembly instructions that make up my Go program?