-
Notifications
You must be signed in to change notification settings - Fork 25
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
GetIpInfoBatch: panic: interface conversion: interface {} is *interface {}, not *ipinfo.Core #52
Comments
Are you putting a real token and not getting rate limited? Either of these may cause the issue, but please do confirm. |
I just checked and I was able to replicate the error if you put an empty string in the client as token then it throws this error client := ipinfo.NewClient(nil, nil, "") So putting the token should solve your issue. |
I see. Can we fix so that it doesn't panic, and instead just returns an error? |
I think a simple check on the token can solve this issue. |
The error also occurs if we put an invalid IP in the batch request batchResult, err := client.GetIPInfoBatch(
[]net.IP{
net.ParseIP("1.1.1.1"),
net.ParseIP("8.8.8.8"),
net.ParseIP(""),
} |
Will do a patch release then you can try again. |
@jcace just released |
thanks! looks like it works now. Tested Must've been an invalid IP address because I'm getting expected result now. Error message is much better too when I pass in an invalid one. |
The
GetIPInfoBatch
method does not work, it always creates this errorinterface conversion: interface {} is *interface {}, not *ipinfo.Core
Example code:
Expected output: IP Info for the batch
Actual output:
The text was updated successfully, but these errors were encountered: