

- #Goland sync dependencies install#
- #Goland sync dependencies update#
- #Goland sync dependencies license#

#Goland sync dependencies install#
For example, install plugins to get the following features: How does "go get" command know which files should be downloaded?.Plugins extend the core functionality of GoLand.
#Goland sync dependencies update#
You can also use " go get -u" to update packages and their dependencies. If you only want to download the source files, and not compile and install, using " go get -d" command: # tree Mv $WORK//NanXiao/playstack/play/_obj/exe/a.out /root/gocode/bin/playįrom the above output, we can see playstack repository is cloned first, then stack, At last the compilation and installation are executed. usr/local/go/pkg/tool/linux_amd64/link -o $WORK//NanXiao/playstack/play/_obj/exe/a.out -L $WORK -L /root/gocode/pkg/linux_amd64 -extld=gcc -buildmode=exe -buildid=e9a3c02979f7c6e57ce4452278c52e3e0e6a48e8 $WORK//NanXiao/playstack/play.a usr/local/go/pkg/tool/linux_amd64/compile -o $WORK//NanXiao/playstack/play.a -trimpath $WORK -p main -complete -buildid e9a3c02979f7c6e57ce4452278c52e3e0e6a48e8 -D _/root/gocode/src//NanXiao/playstack/play -I $WORK -I /root/gocode/pkg/linux_amd64 -pack. Mkdir -p $WORK//NanXiao/playstack/play/_obj/exe/Ĭd /root/gocode/src//NanXiao/playstack/play Mkdir -p $WORK//NanXiao/playstack/play/_obj/

Mv $WORK//NanXiao/stack.a /root/gocode/pkg/linux_amd64//NanXiao/stack.a Mkdir -p /root/gocode/pkg/linux_amd64//NanXiao/ usr/local/go/pkg/tool/linux_amd64/compile -o $WORK//NanXiao/stack.a -trimpath $WORK -p /NanXiao/stack -complete -buildid de4d90fa03d8091e075c1be9952d691376f8f044 -D _/root/gocode/src//NanXiao/stack -I $WORK -pack. Git clone /root/gocode/src//NanXiao/stackĬd /root/gocode/src//NanXiao/stack Git clone /root/gocode/src//NanXiao/playstackĬd /root/gocode/src//NanXiao/playstack The mechanism behind " go get" command is it will fetch the repositories of packages and dependencies (E.g., use " git clone".), and you can check the detailed workflow by " go get -x": # tree We can see not only playstack and its dependency ( stack) are all downloaded, but also the command ( play) and library ( stack) are all installed in the right place. Tidy up $GOPATH folder, and execute " go get /NanXiao/playstack/play" instead: # tree ", and it is because the objects which " go get" works are packages, not repositories.There is no *.go source files in playstack, so it is not a valid package. " go get" command complains " no buildable Go source files in. Package /NanXiao/playstack: no buildable Go source files in /root/gocode/src//NanXiao/playstack Ĭlean the $GOPATH directory, and use " go get" command to download playstack: # tree So the directory structure of playstack looks like this. Actually, the main() function doesn't play anything meaningful, and we just use this project as a sample. The main package has one dependency package: stack. (3) The play directory includes one main.go file: package main
#Goland sync dependencies license#
(2) There is a LICENSE file and play directory in playstack folder (1) Create a playstack repository in github " go get" command is the standard way of downloading and installing packages and related dependencies, and let's check the particulars of it through an example: Use sync.WaitGroup to synchronize goroutines Decorate types to implement io.Reader interface
