Skip to content

Instantly share code, notes, and snippets.

View erichanson's full-sized avatar

Eric Hanson erichanson

View GitHub Profile
@dstroot
dstroot / handlers.go
Last active April 10, 2023 13:22 — forked from 3n21c0/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"io"
"net/http"
"sync/atomic"
)
func index() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@3n21c0
3n21c0 / main.go
Last active September 17, 2026 13:57
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@teknoraver
teknoraver / unixhttpc.go
Last active August 30, 2026 12:03
HTTP over Unix domain sockets in golang
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"