auth0-samples / auth0-golang-api-samples

Auth0 Integration Samples for Go REST API Services
https://auth0.com/docs/quickstart/backend/golang
MIT License
129 stars 67 forks source link

Getting Token Information vscode Error #52

Closed markusheinemann closed 2 years ago

markusheinemann commented 2 years ago

I have struggled for some hours with a wired error when trying to access the token data. I use the code snippet from this example.

token := r.Context().Value(jwtmiddleware.ContextKey{}).(*validator.ValidatedClaims)

If the code is executed everything works as excepted. But the compiler of my editor (vscode) complains about an error.

image

Is this anything related to the library/example or is this a bug in the editor?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️

sergiught commented 2 years ago

Hey @markusheinemann, apologies for the late reply on this one, the code from your screenshot is actually correct. I can't see anything wrong with it. I'm suspecting an issue with how the imports are loaded and indexed in VSCode. Especially considering that your code executes normally. If there would have been any issues it wouldn't have compiled. Because of this I'm closing this down.