使用方式:
$ gf pack -hUSAGEgf pack SRC DSTARGUMENTSRC source path for packing, which can be multiple source paths.DST destination file path for packed file. if extension of the filename is ".go" and "-n" option is given,it enables packing SRC to go file, or else it packs SRC into a binary file.OPTION-n, --name package name for output go file, it's set as its directory name if no name passed-p, --prefix prefix for each file packed into the resource fileEXAMPLESgf pack public data.bingf pack public,template data.bingf pack public,template packed/data.gogf pack public,template,config packed/data.gogf pack public,template,config packed/data.go -n=packed -p=/var/www/my-appgf pack /var/www/public packed/data.go -n=packed
该命令用以将任意的文件打包为资源文件或者Go代码文件,可将任意文件打包后随着可执行文件一同发布。此外,在build命令中支持打包+编译一步进行,具体请查看build命令帮助信息。关于资源管理的介绍请参考 资源管理 章节。
使用示例:
$ gf pack public,template packed/data.godone!$ ll packedtotal 184-rw-r--r-- 1 john staff 89K Dec 31 00:44 data.go
