Hacker News new | ask | show | jobs
by vldo 2689 days ago
> Usually this can be resolved by creating a new function and calling that from the loop. But frequently not. [etc.]

For me this is the appeal of the language; I really prefer things confined and manually scoped rather than having things globally scoped which would cause a lot of debate just around that. You often have to think about what you want to expose and where, but that's a good thing in my opinion.

1 comments

    for _, f := range fs {
      func() {
        defer f.Close()
      }()
    }