Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97371

VSC "could not import" problems

$
0
0

I am currently trying to learn golang. One of the courses I'm following requires me to setup different packages. When I'm working in my project, VSC appears to randomly alert me of the following two compiler problems: Printscreen of VSC

I use the word 'randomly' because when I was working on it 1 hour ago, it didn't provide me with any problems and I was able to build and execute my webservice. However, now I'm not able to this anymore, despite the fact that I didn't change anything to the code. Any help on this issue would be greatly appreciated as this is really demotivating me.. Thank you in advance for reading and any help offered! Lastly, apologies in advance if this is a noob mistake/oversight on my part.

edit:

I just commented line 9 and 10 (http.handle objects), saved the file and subsequently the import "net/http" automatically disappeared when saving the changes. then, I uncommented line 9 and 10 again, saved the file, and resulted in the automatic importing of "net/http" package again. However, it ALSO removed the 2 compiler problems I had before. Why is this? It feels very strange and inefficient to me.. As mentioned, any help and clarity is appreciated.


Viewing all articles
Browse latest Browse all 97371

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>