Go命令基础之go build
来源:互联网 发布:excel一列数据求和 编辑:程序博客网 时间:2024/05/16 02:39
一 简介
1、用于编译源码文件或代码包。
2、编译非命令源码文件不会产生任何结果文件。
3、编译命令源码文件会在该命令的执行目录中生成一个可执行文件。
4、执行该命令且不追加任何参数时,它会试图把当前目录作为代码包并编译。
5、执行该命令且以代码包的导入路径作为参数时,该代码包及其依赖会被编译。
加入-a标记后,所有涉及到的代码包都会被重新编译。
不加入-a标记,则只会编译归档文件不是最新的代码包。
6、执行该命令且以若干源码文件作为参数时,只有这些文件会被编译。
二 实战
[root@localhost ds]# ls
showds.go
[root@localhost ds]# go build showds.go
[root@localhost ds]# ls
showds showds.go
[root@localhost ds]#./showds
/root/goc2p/src/helper/ds:
showds.go
showds
[root@localhost ds]# go run showds.go
/root/goc2p/src/helper/ds:
showds.go
showds
[root@localhost ds]# cd ../../pkgtool/
[root@localhost pkgtool]# pwd
/root/goc2p/src/pkgtool
[root@localhost pkgtool]# go build
[root@localhost pkgtool]# ls
envir.go envir_test.go fpath.go ipath.go pnode.go util.go util_test.go
阅读全文
0 0
- Go命令基础之go build
- Go命令基础之go run
- Go命令基础之go install
- Go命令基础之go get
- go build命令
- go build 命令
- go标准命令详解0.1 go build
- go标准命令详解0.1 go build
- go run go build go install 命令解释
- 【Go】build 和 install命令
- go语言之go run/build/install/get
- Go 基础之数据类型、变量
- javaer to go之基础
- Go 语言基础之变量
- GO命令
- Go命令
- go命令
- Go基础
- VS+QT移植问题(vs中打开就是移植了)
- Go语言第一课
- Go常用概念和定义
- Go命令基础之go run
- CSS3动画控制元素阶梯显示
- Go命令基础之go build
- python flask 图片在线浏览或者直接下载的解决
- jdk1.7Timsort 排序异常小结
- 键盘键值表
- HTTP、HTTPS、SPDY、HTTP2.0
- 使用 CocoaPods 给微信集成 SDK 打印收发消息
- Linux下安装go
- RestTemplate post表单,post写入流
- DB2 (OLAP函数的使用)