Go: Using a Closure in Place of a Struct
Published in
2 min readMar 31, 2021
This note isn’t suggesting a pattern to follow, it’s a thought exercise. Let’s look at using a closure where we’d idiomatically use a struct.
A Fibonacci Number Sequence Generator
For this thought exercise, we will implement a Fibonacci Number sequence generator two ways, once with a struct and once with a closure. We’ll use the same approach…