URL
Overview
URL wraps net/url.URL with Node-friendly helpers.
Part of the url package — Node.js analog: url, querystring.
URL is a type exported by gox. Methods on this type are documented separately.
Signature
go
type URL struct {
*url.URL
}Compare: Node.js · Standard Go · gox
js
// Typical url, querystring pattern in Node.jsgo
// Use the underlying stdlib or driver directly.
// See package overview for escape hatches.go
import "github.com/sahilkhaire/gox/url"
u, err := Parse("https://example.com/a?x=1")
res, err := Resolve("https://example.com/foo/", "bar")
vals, err := ParseQuery("a=1&b=2")Example
go
import "github.com/sahilkhaire/gox/url"
u, err := Parse("https://example.com/a?x=1")
res, err := Resolve("https://example.com/foo/", "bar")
vals, err := ParseQuery("a=1&b=2")Tips
Browse methods on this type in the sidebar for handler-style APIs and options structs.
Standard library alternative
gox wraps the Go standard library or a trusted dependency with Node-familiar naming. You can use the underlying library directly — see the package overview for escape hatches.