Created
February 1, 2022 09:53
-
-
Save AntonStoeckl/43d33e7936f0bceb02f99efa6707ba14 to your computer and use it in GitHub Desktop.
Example for blog post: Go bits: Magic with functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package closures | |
// IsBiggerThan returns a closure function that is parametrized with the | |
// first parameter | |
func IsBiggerThan(first int) func(second int) bool { | |
isBigger := func(second int) bool { | |
return second > first | |
} | |
return isBigger | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment