Registry / web-framework / bmizerany-pat

bmizerany-pat

JSON →
library0.0.0-20210406213842-e4b6760bdd6fgogounverified

Package pat implements a simple URL pattern muxer.

go get github.com/bmizerany/pat
INSTALL
IMPORT
SIG · BMIZERANY-PAT
B
bmizerany-pat
web-frameworkgov0.0.0-20210406213842-e4b6760bdd6f
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pat
github.com/bmizerany/pat

Create a simple HTTP server with named URL parameters.

package main import ( "net/http" "github.com/bmizerany/pat" ) func main() { mux := pat.New() mux.Get("/hello/:name", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello, " + r.URL.Query().Get(":name"))) })) http.ListenAndServe(":8080", mux) }
Debug
Known issues
gotchaPat is no longer actively maintained; consider using chi or gorilla/mux instead.
fix
Migrate to a more maintained router like github.com/go-chi/chi.
affects: all
Upgrade
Version history
0.0.0-20210406213842-e4b6760bdd6flatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
bmizerany-pat — go get bmizerany-pat · libregistry