an introduction
Used to run command source files.
Only one command source file and several library source files can be accepted as file parameters.
Its internal execution steps are: first compile the source file and then run
Two goc2p project introduction
1. Project address
2. Project description
Example project of "go concurrent programming practice"
3. Project installation
Get the project with git clone and use its root directory as a workspace
4, ds command and pds command
Three go run command combat
[root@localhost ds]# cd ~
[root@localhost ~]# ls |grep go
go1.8.3.linux-amd64.tar.gz
gobin
goc2p
golib
goproject
[root@localhost ~]# cd goc2p/src/helper/ds
[root@localhost ds]# ls
showds.go
[root@localhost ds]# go run showds.go
/root/goc2p/src/helper/ds:
showds.go
[root@localhost ds]# go run showds.go -p ~/goc2p/src/helper/
/root/goc2p/src/helper/:
ds/
showds.go
pds/
showpds.go
The use of four commonly used go run tags
Five Commonly Marked Case Demonstrations
[root@localhost ds]# go run showds.go
/root/goc2p/src/helper/ds:
showds.go
[root@localhost ds]# go run -n showds.go
#
# command-line-arguments
#
mkdir -p $WORK/command-line-arguments/_obj/
mkdir -p $WORK/command-line-arguments/_obj/exe/
cd /root/goc2p/src/helper/ds
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/command-line-arguments.a -trimpath $WORK -p main -complete -buildid 8060af8f0adc5e810678187f90009efa4132850d-D _/root/goc2p/src/helper/ds -I $WORK -pack ./showds.go
cd .
/usr/local/go/pkg/tool/linux_amd64/link -o $WORK/command-line-arguments/_obj/exe/showds -L $WORK -w -extld=gcc -buildmode=exe -buildid=8060af8f0adc5e810678187f90009efa4132850d $WORK/command-line-arguments.a
$WORK/command-line-arguments/_obj/exe/showds
[root@localhost ds]# go run -x showds.go
WORK=/tmp/go-build846499095
mkdir -p $WORK/command-line-arguments/_obj/
mkdir -p $WORK/command-line-arguments/_obj/exe/
cd /root/goc2p/src/helper/ds
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/command-line-arguments.a -trimpath $WORK -p main -complete -buildid 8060af8f0adc5e810678187f90009efa4132850d-D _/root/goc2p/src/helper/ds -I $WORK -pack ./showds.go
cd .
/usr/local/go/pkg/tool/linux_amd64/link -o $WORK/command-line-arguments/_obj/exe/showds -L $WORK -w -extld=gcc -buildmode=exe -buildid=8060af8f0adc5e810678187f90009efa4132850d $WORK/command-line-arguments.a
$WORK/command-line-arguments/_obj/exe/showds
/root/goc2p/src/helper/ds:
showds.go
[root@localhost ds]# go run -v showds.go
command-line-arguments
/root/goc2p/src/helper/ds:
showds.go
[root@localhost ds]# go run -work showds.go
WORK=/tmp/go-build568181490
/root/goc2p/src/helper/ds:
showds.go