Skip to content

Instantly share code, notes, and snippets.

@joyrexus
Last active April 9, 2023 22:43
Show Gist options
  • Save joyrexus/b356daf89a22cfea7079 to your computer and use it in GitHub Desktop.
Save joyrexus/b356daf89a22cfea7079 to your computer and use it in GitHub Desktop.
golang web dev

Resources for golang web development.

Examples

General

Introductory articles and tutorials

Forms

Useful packages for creating and processing form data include:

Templates

Authentication

Static Content

Middleware

How to share context and functionality

If you're using a middleware pattern to process HTTP requests in Go, you may want to share some data or context between middleware handlers and your application handlers.

HTTP APIs

For material specifically focused on HTTP API / web service development, see this gist.

Packages

The gorilla web toolkit provides a fairly comprehensive set of web utility packages.

For basic routing, I like httprouter ... and, along similar lines, httptreemux.

Both gin-gonic and echo appear to be nice/performant micro-web frameworks.

Other stuff ...

  • gin - live reloading
  • negroni - bidirectional middleware flow
  • render - improved templating
  • sqlx - convenient extensions to database/sql
  • cors - CORS middleware
  • goth - multi-provider authentication
  • goji - a basic router providing request context
  • gorilla/context - registry for global request variables
  • go-form-it - easy form creation and handling

Reference

Status Codes

Header Fields

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment