First you should confirm that vscode is picking up your GOPATH. If you open the terminal view in vscode and type
echo $GOPATH
to confirm the gopath matches. Then you need to open VSCode to the location of your Go chaincode which must be in the src
directory in your go workspace pointed to by your go path. For example here is my go chaincode project called testcc and the actual chaincode source is in mycc
└── testcc
├── bin
├── pkg
│ └── linux_amd64
└── src
├── github.com
├── golang.org
└── mycc
located at ~/mycode
. Therefore I would have a GOPATH of ~/mycode/testcc
and I would open vscode up at the mycc directory. For example I would launch vscode as follows
$ GOPATH=~/mycode/testcc code ~/mycode/testcc/src/mycc