Had a rubber-ducking session with myself between passing auth info within the Go Context through to the service methods, or passing them as explicit parameters.

I decided to go with passing it as explicit parameters. It’s kinda painful to see both the auth info passed through in both the Go context and a parameter. But it will result in more readable code, and it does make it clear that this information is needed. Plus, we’re already doing this already in the codebase I’m working on already (previously it was just the user ID, but we’re going to be including some additional auth info alongside it).

I am kinda glad that this tension has been resolved. It’s been weighing on me a little.

Also, for a bit of fun, I wrote this rubber-ducking session in a post. Well, it’s not entirely for fun: that’s how I was able to work through the problem. But writing it as a dialogue and posting it online was fun.