Registry / utility / go-pg-urlstruct

go-pg-urlstruct

JSON →
library1.0.1gogounverified

Maps URL query parameters to Go struct fields using struct tags, simplifying HTTP request parsing.

go get github.com/go-pg/urlstruct
INSTALL
IMPORT
SIG · GO-PG-URLSTRUCT
G
go-pg-urlstruct
utilitygov1.0.1
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.

urlstruct
github.com/go-pg/urlstruct

Unmarshals URL query parameters into a struct.

package main import ( "fmt" "net/url" "github.com/go-pg/urlstruct" ) type Params struct { Name string `url:"name"` Age int `url:"age"` } func main() { u, _ := url.Parse("http://example.com?name=John&age=30") var p Params urlstruct.Unmarshal(u, &p) fmt.Printf("%+v\n", p) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.0.1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
go-pg-urlstruct — go get go-pg-urlstruct · libregistry