-
Notifications
You must be signed in to change notification settings - Fork 7
Cleanup package architecture #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I like this direction! I really like how everything in the What's the logic behind including |
There's a lot of different logic in api.go, and I was thinking it does at least make sense to separate the web-request-handling logic from the others.
Good question! I had it in a separate package previously, then decided it really didn't need to be there yet since |
I'm still not certain the current separation between |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really great!
_ "github.com/joho/godotenv/autoload" | ||
) | ||
|
||
func pingHandler(w http.ResponseWriter, r *http.Request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to get this out of main.go :)
This will probably conflict with any changes, but the gist of it is to move things and clean up the API abstraction a bit!
api.go
,middleware.go
,email.go
toapi/
andutil.go
toutil/
-- althoughutil
is bare enough that I might move the individual functions to other places.There's no rush to land this, just something I'm playing around with. Let me know what you think!