more advanced of function type
tags: learning go programming
content
- the example in go-function-type is not too significant
- but from there we can extend to go-middleware:
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)
}
}