Format
Overview
Format returns the serialized URL (url.format).
If you are coming from Node.js, the closest pattern is url.format(obj).
Signature
go
func Format(u *URL) stringCompare: Node.js · Standard Go · gox
js
url.format(obj)go
u := &url.URL{Scheme: "https", Host: host, Path: path}go
import "github.com/sahilkhaire/gox/url"
url.Format(u)Example
go
import "github.com/sahilkhaire/gox/url"
url.Format(u)Tips
Import github.com/sahilkhaire/gox/url and call Format directly. See the comparison below for the standard library equivalent.
Standard library alternative
Use the standard library directly:
go
u := &url.URL{Scheme: "https", Host: host, Path: path}