I want to check the URL address for validity, but url.Parse() does not give any errors, etc., the URL itself. The address looks like http://validate/ , it is not a valid URL at all, but not url.Parse() , not govalidator.IsURL() does not give anything suspicious and no error, in the end I have an invalid URL address .. What are the correct and valid methods to validate the http/https url address?

  • Try to access the site and download content. if the content error is 404 - then it is not valid - michael_best
  • This is a valid URL. A user in /etc/hosts or in a local DNS may well have such a host. - Ainar-G
  • @Ainar-G I thought so too .. for now I’ll probably write my wrapper for validating the url address I need. - Mothership
  • @michael_best in general, error 404 does not affect the validity of the URL, the invalid url of the address means the error of the parsing of this address, the error of the parsing of the scheme, the parameters of the address, and so on. - Mothership

0