News for hackers. Stuff that matters.
Re:Griping about Go by vldo on Thursday February 07, 2019 @06:17PM (#19109672)
> 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.

Re:Griping about Go by cpuguy83 on Thursday February 07, 2019 @06:49PM (#19109879)

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