(1) You must set the GOPATH, example in Windows XP
C:> mkdir -p c:\go-others\src
C:> set GOPATH=c:\go-others
(2) Copy the third-party code under the "c:\go-others\src" folder. Make it organized and neat, example, if your project name is "MyProject" do something like this.
C:> mkdir -p c:\go-others\src\mydomain.com\myclient_a\MyProject
C:> go install mydomain.com\myclient_a\MyProject
(3) You can now use the third-party code,
(1) under the MyProject folder you have the files
each of these files should have the
phrase "package MyProject" at the beginning or at the top of the file
(2) under the "subpkg" folder you have the
each of these files should have the phrase "package subpkg" at the beginning or at the top of the file
(1) when the error is "cannot refer to unexported name"
Try the following:
- capitalize the first letter of your function in that package that you wish to call
- it is case-sensitive, check your function call