Fix #22, wrap while loop with iife in goEffImpl.

@ethul @garyb How does this look?