Example: both net/http and github.com/gorilla/websocket use net/url, but if you try do to this:
_ = &websocket.Dialer{
Proxy: http.ProxyFromEnvironment,
}
you get this:
cannot use http.ProxyFromEnvironment (value of type func(req *net/http.Request) (*net/url.URL \ ?error)) as func(req *net/http.Request) (*net/url.URL \ ?error) value in struct literal
because SGo believes that net/url.URL is a different type in both signatures.
If you import net/url as well, it does work. So doing import _ "net/url" is a workaround.
Example: both
net/httpandgithub.com/gorilla/websocketusenet/url, but if you try do to this:you get this:
because SGo believes that
net/url.URLis a different type in both signatures.If you import
net/urlas well, it does work. So doingimport _ "net/url"is a workaround.