[go-nuts] Expectations for errors.Is/As with error trees

2019-09-03 Thread 'Abhinav Gupta' via golang-nuts
Hey friends, We own a library, multierr that supports writing combining zero or more errors into a single error. It supports an API like, err := multierr.Combine(err1, err2, ...) With the release of Go 1.13, we’re trying to evaluate what the expected beha

Re: [go-nuts] Re: Expectations for errors.Is/As with error trees

2019-09-09 Thread 'Abhinav Gupta' via golang-nuts
Hey, Thanks for your response. Although we were unsure about this at first (which is why we started this thread), after further discussion we agree that this API makes sense. Part of the discussion is summarized below for others trying to make a similar decision, and to help plan future APIs aroun

Re: [go-nuts] Dependency injection in gorillamux handlers

2019-09-23 Thread 'Abhinav Gupta' via golang-nuts
You can place the dependencies into a struct and use a bound method on that as your handler. So you build a struct that will hold application-scoped objects like Redis client, content.Updater, etc. package contact type Handler struct { Redis *redis.Client Updater *content.Updater Ma