新聞中心
?GOFrame?框架提供了功能強(qiáng)大的?gf?命令行開發(fā)輔助工具,是框架發(fā)展的一個(gè)重要組成部分,工具地址:

創(chuàng)新互聯(lián)公司專注于萬(wàn)柏林企業(yè)網(wǎng)站建設(shè),成都響應(yīng)式網(wǎng)站建設(shè)公司,商城網(wǎng)站制作。萬(wàn)柏林網(wǎng)站建設(shè)公司,為萬(wàn)柏林等地區(qū)提供建站服務(wù)。全流程按需搭建網(wǎng)站,專業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,創(chuàng)新互聯(lián)公司專業(yè)和態(tài)度為您提供的服務(wù)
- https://github.com/gogf/gf/tree/master/cmd/gf
工具安裝請(qǐng)參考倉(cāng)庫(kù)頁(yè)面。工具安裝成功后,可以通過?gf?或者?gf -h?查看所有支持的命令。復(fù)雜的命令可以通過?gf COMMAND -h?查看更詳細(xì)的使用幫助信息,例如:?gf gen -h?。
工具職責(zé)
- 簡(jiǎn)化工程開發(fā),提高開發(fā)效率
- 支持框架工程設(shè)計(jì)規(guī)范準(zhǔn)確落地
注意事項(xiàng)
- 部分命令需要您先安裝好Golang基礎(chǔ)的開發(fā)環(huán)境。
- 最新的?
CLI?工具版本會(huì)隨著最新的框架版本走。
配置支持
工具的所有命令均同時(shí)支持命令行及配置文件配置參數(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
注意以上配置示例僅供參考,具體配置項(xiàng)請(qǐng)參考具體命令幫助。
工具調(diào)試
當(dāng)在工具的使用中遇到問題時(shí),可以嘗試打開工具的調(diào)試模式獲得更詳細(xì)的工具執(zhí)行日志信息,打開工具調(diào)試模式可以通過?gf.debug?命令行選項(xiàng)開啟,例如:
gf build main.go --gf.debug
由于?gf?工具也是使用?GoFrame?框架開發(fā),因此調(diào)試信息的開啟也是同框架方式一致。
命令總覽
當(dāng)前幫助文檔以?gf cli v2.0.0?版本為例進(jìn)行簡(jiǎn)單的介紹,詳細(xì)的介紹信息請(qǐng)查看命令行幫助信息。本章內(nèi)容信息可能會(huì)有滯后,最新的具體詳細(xì)介紹請(qǐng)查看工具幫助信息。
$ 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.
本文名稱:創(chuàng)新互聯(lián)GoFrame教程:GoFrame開發(fā)工具-簡(jiǎn)介
當(dāng)前網(wǎng)址:http://fisionsoft.com.cn/article/dhdjgse.html


咨詢
建站咨詢
