jpillora / go-tld

TLD Parser in Go
MIT License
127 stars 19 forks source link

panic: runtime error: index out of range while processing "google com" #3

Closed time2die closed 5 years ago

time2die commented 5 years ago

This simply code make panic error

package main

import (
    "fmt"
    "github.com/jpillora/go-tld.git"
)

func main() {
    var test1, _ = tld.Parse("http://google.com")
    fmt.Print(test1)
}
panic: runtime error: index out of range

goroutine 1 [running]:
.../vendor/github.com/jpillora/go-tld%2egit.Parse(0x4cc0dc, 0x11, 0xc420059f58, 0x0, 0x0)
        .../vendor/github.com/jpillora/go-tld.git/parse.go:50 +0x4f2
main.main()
        .../app/cmd/TestGolangLanguage.go:9 +0x36
JohnDotOwl commented 5 years ago

@time2die did you manage to fix it????? @jpillora

jpillora commented 5 years ago

Fixed in https://github.com/jpillora/go-tld/commit/f16ca3b7b383d3f0373109cac19147de3e8ae2d1 Sorry forgot to close