0
点赞
收藏
分享

微信扫一扫

go 命令行处理 flag


命令行格式

进程名  command  --falg(或者-flag缩写)

如: consul agent -dev

 

var confFile string
func init() {
flag.StringVar(&confFile, "c", "./feed_queue.conf", " set feed queue config file path")
//flag.StringVar(&confFile, "c", "/Users/zhuyi/Documents/go_projects/src/goim/logic/logic-example.conf", " set logic config file path")
}

如果使用VSCode,则在配置文件中添加 "args": ["-c=mytest.ini"]或者"args": ["--c=mytest.ini"]

 

 

 

举报

相关推荐

0 条评论