This is a weird approach. They are essentially manually implementing the “yield return” functionality from c#.
C# defines an interface IEnumerable<T> with a “next” method, and originally you’d need to implement this interface which was a bit of boiler plate.
They added “yield return” which would create compiler generated syntax sugar to return a generator function like this go proposal, but your code looked identical to a non iterative version.
The go proposal feels like the worst of both worlds and like the team misunderstood the purpose.