Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Link / Extension not Supported .PDF , .HTMLetc #4

Open
JohnDotOwl opened this issue Mar 27, 2019 · 0 comments
Open

Document Link / Extension not Supported .PDF , .HTMLetc #4

JohnDotOwl opened this issue Mar 27, 2019 · 0 comments

Comments

@JohnDotOwl
Copy link

package main

import (
	"fmt"

	"github.com/jpillora/go-tld"
)

func main() {
	urls := []string{
		"http://google.com",
		"http://blog.google",
		"https://www.medi-cal.ca.gov/",
		"https://ato.gov.au",
		"http://a.very.complex-domain.co.uk:8080/foo/bar",
		"https://s3.amazonaws.com/happiness-report/2019/WHR19.pdf",
		
		
	}
	for _, url := range urls {
		u, _ := tld.Parse(url)
		fmt.Printf("%50s = [ %s ] [ %s ] [ %s ] [ %s ] [ %s ]\n",
			u, u.Subdomain, u.Domain, u.TLD, u.Port, u.Path)
	}
}

panic: runtime error: index out of range

this lib is easy to use, i love it :)

@JohnDotOwl JohnDotOwl changed the title Document Link not Supported .PDF etc Document Link / Extension not Supported .PDF , .HTMLetc Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant