I did a "go get" to install github.com/chsc/gogl. Apparently this seems to have put stuff in C:\\Go\\src\\pkg\\github.com\\chsc\\gogl. And when I import "github.com/chsc/gogl" I can use the package just fine.
But suppose I wanted to make some edits to the package. How do I manage and organize my projects and code? Where do I put my copy of gogl and how do I get all my projects to use my copy of gogl instead of the one installed under C:\\Go\\src\\pkg\\github.com\\chsc\\gogl?
You could modify the code in C:\\Go\\src\\pkg\\github.com\\chsc\\gogl, and run "go install github.com/chsc/gogl".
Alternatively, if you are going to be making changes for the long term, your better bet is to fork that project on github, and use your fork instead (github.com/yourname/gogl).
You can have a copy of gogl from github.com in your project folder:
make the C:/my_go_project/local_github.com/chsc/gogl folder
copy all the contents from C:\\Go\\src\\pkg\\github.com\\chsc\\gogl
to C:\\my_go_project\\local_github.com\\chsc\\gogl
include your library in your .go files like
import "local_github.com/chsc/gogl"
Now you can edit your local copy as you wish.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.