W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗(yàn)值獎勵
?GoFrame
?框架提供了功能強(qiáng)大的?gf
?命令行開發(fā)輔助工具,是框架發(fā)展的一個重要組成部分,工具地址:
工具安裝請參考倉庫頁面。工具安裝成功后,可以通過?gf
?或者?gf -h
?查看所有支持的命令。復(fù)雜的命令可以通過?gf COMMAND -h
?查看更詳細(xì)的使用幫助信息,例如:?gf gen -h
?。
CLI
?工具版本會隨著最新的框架版本走。工具的所有命令均同時支持命令行及配置文件配置參數(shù),以提高易用性。配置文件路徑優(yōu)先查找當(dāng)前目錄下的?hack
?目錄,其次按照框架默認(rèn)的配置路徑檢索配置文件。
以?gf gen dao
?命令的配置文件的格式示例:
# GoFrame CLI tool configuration.
gfcli:
gen:
dao:
- link: "mysql:root:12345678@tcp(127.0.0.1:3306)/test"
tables: "user"
removePrefix: "gf_"
descriptionTag: true
noModelComment: true
注意以上配置示例僅供參考,具體配置項請參考具體命令幫助。
當(dāng)在工具的使用中遇到問題時,可以嘗試打開工具的調(diào)試模式獲得更詳細(xì)的工具執(zhí)行日志信息,打開工具調(diào)試模式可以通過?gf.debug
?命令行選項開啟,例如:
gf build main.go --gf.debug
由于?gf
?工具也是使用?GoFrame
?框架開發(fā),因此調(diào)試信息的開啟也是同框架方式一致。
當(dāng)前幫助文檔以?gf cli v2.0.0
?版本為例進(jìn)行簡單的介紹,詳細(xì)的介紹信息請查看命令行幫助信息。本章內(nèi)容信息可能會有滯后,最新的具體詳細(xì)介紹請查看工具幫助信息。
$ gf
USAGE
gf COMMAND [OPTION]
COMMAND
env show current Golang environment variables
run running go codes with hot-compiled-like feature
gen automatically generate go files for dao/dto/entity/pb/pbentity...
init create and initialize an empty GoFrame project
pack packing any file/directory to a resource file, or a go file
build cross-building go project for lots of platforms
docker build docker image for current GoFrame project
install install gf binary to system (might need root/admin permission)
version show version information of current binary
OPTION
-y, --yes all yes for all command without prompt ask
-v, --version show version information of current binary
-d, --debug show internal detailed debugging information
-h, --help more information about this command
ADDITIONAL
Use "gf COMMAND -h" for details about a command.
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: