package main

import "fmt"

func main() {
	command := "addition"
	res := retFunc(command)
	fmt.Println("Result is ",res(10,30))
	fmt.Println("Type is %T",res)
}

func retFunc (a string) func(a,b int) int {
	if a == "addition" {
		return func(a,b int) int {return a + b}
	} else {
		return func(a,b int) int {return  a - b}
	}
}
