网站建设与推广是什么意思,网站开发项目资金运用明细,wordpress scandir,如何破解网站后台密码使用gin搭建服务的时候#xff0c;在开发环境修改代码#xff0c;要关闭服务#xff0c;再重新打开代码才能生效。
频繁修改再打开是一个很低效的事情。所以需要一个工具#xff0c;在修改完代码之后可以热启动。
可以使用 air来完成。
安装
go install github.com/cos…使用gin搭建服务的时候在开发环境修改代码要关闭服务再重新打开代码才能生效。
频繁修改再打开是一个很低效的事情。所以需要一个工具在修改完代码之后可以热启动。
可以使用 air来完成。
安装
go install github.com/cosmtrek/airlatest配置
air不会自动配置路径需要我们添加
alias air$(go env GOPATH)/bin/air然后添加一个air的配置文件
root .
testdata_dir testdata
tmp_dir tmp[build]args_bin []bin ./tmp/maincmd go build -o ./tmp/main .delay 1000exclude_dir [assets, tmp, vendor, testdata]exclude_file []exclude_regex [_test.go]exclude_unchanged falsefollow_symlink falsefull_bin include_dir []include_ext [go, tpl, tmpl, html]kill_delay 0slog build-errors.logsend_interrupt falsestop_on_error true[color]app build yellowmain magentarunner greenwatcher cyan[log]time false[misc]clean_on_exit false[screen]clear_on_rebuild false执行命令
air即可
修改bash zsh
vim ~/.zshrc
# or we can
# vim ~/.bash_profile# Add this in the file
alias air$(go env GOPATH)/bin/air这样以后打开的新的终端都可以应用了