Try this code
***
package main
import "fmt"
func division(x int, y int) {
var result float64
if y != 0 {
result = float64(x/y)
fmt.Printf("The result for division of %d by %d is %0.2f",x,y,result)
} else {
fmt.Printf("You cannot divide a number by 0")
}
}
func main() {
// call the function
division(12, 4)
}
***