Problem in GOPATH variable

My GOROOT path :-


I have set GOPATH to :-


but when I import modules (like “”) in VS Code. VS Code prompts me this error :-

could not import (cannot find package "" in any of 
C:\Go\src\\gorilla\mux (from $GOROOT)
C\src\\gorilla\mux (from $GOPATH)
\Users\kunal\go\src\\gorilla\mux (from $GOPATH))

From above It is clear that it shows me two different GOPATH which I haven’t set. How do I fix this?

GOPATH is obsolete.
Use go modules (with go version 1.16).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.