Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I frequently use that pattern. For example, something like this:

    a := Start()
    if thingEnabled {
      thing := connectToThing()
      defer thing.Close()
      a.SetThing(thing)
    }
    a.Run(ctx)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: