News for hackers. Stuff that matters.
Re:Your DI framework is killing your code by zeveb on Tuesday September 29, 2015 @10:43AM (#10296648)
Exactly! This is why Lisp has dynamic variables:

    (let ((*emailer* mailgun-client))
      (send email))
Or, using Go contexts (which are just a way of hacking in dynamic variables):

    ctx = email.NewContext(ctx, mailgunClient)
    email.Send(ctx)
And in email.Send:

    emailer, ok := EmailerFromContext(ctx)
    if !ok {
      emailer = defaultSMTPEmailer
    }

There are no comments on this comment yet.