kyoshidajp / ghkw

Search how many keywords in GitHub Code tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Search failed and "403 For bidden" is displayed

eijenson opened this issue · comments

Hi.
Thank you very good tool!

It fails with this command(Not necessarily)
$ ghkw heigth height

results:

403 Forbidden
& {%! s (* http.gzipReader = & {0xc420060400 0xc420150580 <nil>})%! s (func () = <nil>)}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code = 0 × 1 addr = 0 × 0 pc = 0 × 1291 e 67]

goroutine 52 [running]:
main. (* Searcher) .searchRequest (0xc4201802e0, 0x7ffeefbffb0c, 0x6, 0xc42007c240)
/Users/XXXX/go/src/github.com/kyoshidajp/ghkw/cli.go:134 + 0x2a7
created by main. (* Searcher) .search
/Users/XXXX/go/src/github.com/kyoshidajp/ghkw/cli.go:144 + 0xbf

Note: XXXX is probably your user name.

Running it several times may succeed.

Thanks for your detail report.

I guess that this is probably over the limit of GitHub API limitation.

By the way, the problem code about this is here.
https://github.com/kyoshidajp/ghkw/blob/v0.0.1/cli.go#L127-L129

If got error code, then should stop goroutine function which searches request safely.

And similar to #3

Search API returns X-RateLimit-Remaining header which is over one when got 403 error.

I've posted this issue at a community forum.