I want use code.google.com/p/google-api-go-client/drive/v2
and other.
My app is structured like:
+-- MyApp
+---- app.yaml
+---- main.go
+---- src/
+------ ...external package...
My GOPATH is equal to "MyApp/src"
In my main.go I have `// +build !appengine"
I can't launch goapp serve
, I get
2014/12/09 22:20:32 Can't find package "code.google.com/p/google-api-go-client/googleapi" in $GOPATH: cannot find package "code.google.com/p/google-api-go-client/googleapi" in any of:
and many other who said the same.
How I can use package download from a go get
?
Thank you.
Typically a gopath looks like this: (I have added random projects to it to demonstrate what it could look like)
Your $GOPATH$ enviroment variable should point to that root folder which contains src, pkg and bin.
So when you go get a package from github for example it'l be put in the github.com src folder, and that's when you'll be able to use that library in your own projects.
Usage Example
So for example, if I need the fluffle/goirc library from github, I'l type:
The library will then be placed in:
And I can use the library by importing it with:
And then use it