In an URL, the authority is supposed to be optional, meaning that URLs such as mailto:[email protected] are valid.
In Golang 1.15.2, if using the net/url class to make an URL like above, it does not appear to allow creation of URLs without an authority.
E.g.
package main import ( "fmt" "net/url" ) func main() { var theURL = url.URL{} theURL.Scheme = "mailto" theURL.Path = "[email protected]" fmt.Println(theURL.String()) // should be mailto:[email protected], but is mailto://[email protected] } Am I missing something here or is this technically a bug?