Skip to content
Node: url.format(obj)github.com/sahilkhaire/gox/url

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) string

Compare: 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}

← Back to url package overview

MIT Licensed · Built for Node.js developers moving to Go