Higher order functions for Go