Error in importing github libraries in VS Code

I am trying to import an external library from github by typing
go get githubcom/stretchr/testify/assert on VS code terminal
and I encountered the below error:-

cd C:\Users\Rishabh\go\src\src\githubcom\stretchr\testify; git pull --ff-only

From https://githubcom/stretchr/testify
15aff29…e72b029 master -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> master

package githubcom/stretchr/testify/assert: exit status 1

I have added git in my environment variable at: C:\Program Files\Git\bin\go
And my GOPATH is : C:\Users\Rishabh\go\src\githubcom\rishabh(it’s the folder under which I am creating my project).

What Should I do to fix it?

P.S. :- Whereever is githubcom it’s actually github.com.(It’s because only 2 links are allowed to post here)

try

go get githubcom/stretchr/testify
1 Like

now,this error:-

can’t load package: package github.com/stretchr/testify: no Go files in C:\Users\Rishabh\go\src\src\github.com\stretchr\testify

C:\Users\Rishabh\go\src\src\github.com\stretchr\testify
should be
C:\Users\Rishabh\go\src\github.com\stretchr\testify.

Check if your $GOPATH is okay in the environment variables or try deleting the stretchr folder from $GOPATH/github.com and executing
go get github.com/stretchr/testify
again

@gastonpalomeque Thanks it worked!

1 Like