Deprecated: Optional parameter $keys declared before required parameter $cms_id is implicitly treated as a required parameter in /home/www/dev/work/class/blog/CmsKey.php on line 75

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\main::$outlink is deprecated in /home/www/dev/work/website/lvesu/template/blog/cms/cms.tpl on line 2

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\main::$status is deprecated in /home/www/dev/work/website/lvesu/template/blog/index.head.php on line 2
go编译输出指定可执行文件名 - 互联网笔记

略微加速

略速 - 互联网笔记

go编译输出指定可执行文件名

2021-03-05 leiting (6455阅读)

标签 Golang

如果需要指定输出可执行文件名,可以使用-o参数,参见下面的例子:

$ go build -o myexec main.go lib.go
$ ls
lib.go  main.go  myexec
$ ./myexec
call pkgFunc
hello world

上面代码中,在 go build 和文件列表之间插入了-o myexec参数,表示指定输出文件名为 myexec。


北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3