should this routine be called Gallery() or Images() instead of Main()? It looks like the main gallery is used as an example of just one of the galleries that this endpoint can return, based on https://api.imgur.com/endpoints/gallery. Its more general purpose is to fetch the images in a gallery, and keeping the names aligned with that doc would be ideal.
can you add a test, similar to the others in gallery_test.go?
can you gofmt the code?
i'm not sure i agree with the change that moves the declaration of defaultBaseURL - would you mind dropping that commit from the PR?
I was kind of curious about that myself. If you include the '/r' (for subreddits) or the '/g' (for memes) as part of the section specifier, then their API spec starts to look a lot less confusing and a lot more generic. This is the main difference between this route and the rest of them. Making it more generic, then, you could do away with the Random() routine as well, and "random/random" would then become the section. Or, you could potentially unify everything to call the Gallery() method with hard coded '/random' and '/g' prefixes. I agree, it should probably be called Gallery()
Shamefully, I admit that the ONE time I didn't run gofmt -w on it was the commit right before I pushed. Gotta fix that .vimrc
The main reason I did this is that userAgent is derived from libraryVersion, both of which are arguably more "fundamental" to the library than the base URL (if only slightly), but I'd be happy to remove it; it's your library.
Yeah - I agree the organization of their API leaves a little bit to be desired, but my general approach was to more closely mirror it for transparency's sake, rather than create another layer to understand. Maybe Gallery() is the way to go for now.
I could go either way on the defaultBaseURL - I was just reacting to what felt like churn. Probably fine to leave it as you have it.
That works. I think you can also either a) continue pushing commits to your branch and they'll be part of the PR or b) re-checkout a fresh brach locally then force push to the existing branch, such that the PR then consists only of the commits in the forced push. Whatever works for you is fine by me.