I am trying to parse a URL in Go and get host and scheme from the URL. But while parsing the URL with port and without scheme I am getting unexpected result.
u, err := url.ParseRequestURI("hello.com:81")
fmt.Println("host :",u.Host)
fmt.Println("scheme :",u.Scheme)
I am getting unexpected result
host :
scheme: hello.com
I wanted this instead
host : hello.com:80
scheme: