goland debug web app with urfave cli

使用urfave/cli 将应用当做命令行应用启动,定义 start参数来启动
startCmd := cli.Command{Name: "start"}
app.Commands = []cli.Command{versionCmd, startCmd}
app.Run(os.Args)

goland中一直不知道怎么debug 这种cli 启动的项目

下午又研究了下 goland ,发现在 Programma params 中写 对应的start 参数即可

不过启动配置里面要要默认定义好配置的名称,然后点击绿色的虫子debug 按钮就能正常启动; 

goland 里面修改代码后让服务自动重启还没研究,之前用过fswatch,有文章推荐fresh 

go get github.com/pilu/fresh

有机会试试

(https://swsmile.info/2020/01/12/【Golang】修改代码后自动重新编译并启动)

原文地址:https://www.cnblogs.com/lavin/p/12870564.html