how to use anonymous functions in golang