more advanced of function type

tags: learning go programming

content

type Operation(int, int) int
func OperationWithLogging(op Operation) Operation {
	return func(a, b int) int {
		log.Printf("this is logging")
		return op(a, b)
	}
}

up

down

reference