GoFrame 開(kāi)發(fā)工具-資源打包

2022-03-29 15:33 更新

使用方式

$ gf pack -h
USAGE
    gf pack SRC DST

ARGUMENT
    SRC  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 file

EXAMPLES
    gf pack public data.bin
    gf pack public,template data.bin
    gf pack public,template packed/data.go
    gf pack public,template,config packed/data.go
    gf pack public,template,config packed/data.go -n=packed -p=/var/www/my-app
    gf pack /var/www/public packed/data.go -n=packed

該命令用以將任意的文件打包為資源文件或者Go代碼文件,可將任意文件打包后隨著可執(zhí)行文件一同發(fā)布。此外,在?build?命令中支持打包+編譯一步進(jìn)行,具體請(qǐng)查看?build?命令幫助信息。

使用示例

$ gf pack public,template packed/data.go
done!
$ ll packed                             
total 184
-rw-r--r--  1 john  staff    89K Dec 31 00:44 data.go


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)