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

panics and errors when running batch-* examples #37

Closed
przmv opened this issue Feb 15, 2022 · 1 comment
Closed

panics and errors when running batch-* examples #37

przmv opened this issue Feb 15, 2022 · 1 comment

Comments

@przmv
Copy link
Contributor

przmv commented Feb 15, 2022

$ go run batch-asn/main.go 
doing lookup #0
panic: interface conversion: interface {} is *interface {}, not *ipinfo.ASNDetails

goroutine 1 [running]:
github.com/ipinfo/go/v2/ipinfo.(*Client).GetASNDetailsBatch(0x6efba0, {0xc0000621e0, 0x696c48, 0x11}, {0x127ed0, 0x1, 0x1, 0x70})
        /home/petr/go/pkg/mod/github.com/ipinfo/go/[email protected]/ipinfo/batch.go:325 +0x170
main.main()
        /home/petr/go/pkg/mod/github.com/ipinfo/go/[email protected]/example/batch-asn/main.go:21 +0x1e5
exit status 2

$ go run batch-core-netip/main.go 
doing lookup #0
panic: interface conversion: interface {} is *interface {}, not *ipinfo.Core

goroutine 1 [running]:
github.com/ipinfo/go/v2/ipinfo.(*Client).GetIPStrInfoBatch(0xc0000b2470, {0xc0000d41c0, 0x0, 0x4b1500}, {0x10, 0xc, 0x1, 0x70})
        /home/petr/go/pkg/mod/github.com/ipinfo/go/[email protected]/ipinfo/batch.go:294 +0x170
github.com/ipinfo/go/v2/ipinfo.(*Client).GetIPInfoBatch(0x69476b, {0xc0000d1ee0, 0x2, 0x11}, {0xd1ea0, 0x1, 0x1, 0xa0})
        /home/petr/go/pkg/mod/github.com/ipinfo/go/[email protected]/ipinfo/batch.go:266 +0xa5
main.main()
        /home/petr/go/pkg/mod/github.com/ipinfo/go/[email protected]/example/batch-core-netip/main.go:22 +0x257
exit status 2

$ go run batch-core-str/main.go 
doing lookup #0
panic: interface conversion: interface {} is *interface {}, not *ipinfo.Core

goroutine 1 [running]:
github.com/ipinfo/go/v2/ipinfo.(*Client).GetIPStrInfoBatch(0x6efb80, {0xc0000621e0, 0x696c2c, 0x11}, {0x127ed0, 0x1, 0x1, 0x70})
        /home/petr/go/pkg/mod/github.com/ipinfo/go/[email protected]/ipinfo/batch.go:294 +0x170
main.main()
        /home/petr/go/pkg/mod/github.com/ipinfo/go/[email protected]/example/batch-core-str/main.go:21 +0x1e5
exit status 2

$ go run batch-generic/main.go 
doing lookup #0
k=error v=0xc0004ce060

doing lookup #1
k=error v=0xc0004ce1a0

doing lookup #2
k=error v=0xc000091700
@UmanShahzad
Copy link
Contributor

The batch endpoint always requires a token, so these all require the TOKEN environment variable to be set. Then they don't crash.

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

2 participants