fix:修复 flag 参数定义的顺序错误
This commit is contained in:
2
main.go
2
main.go
@@ -19,9 +19,9 @@ var requestCounter int64
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
flag.Parse()
|
|
||||||
port := flag.Int("port", 8080, "代理服务器监听的端口")
|
port := flag.Int("port", 8080, "代理服务器监听的端口")
|
||||||
debug := flag.Bool("debug", false, "是否启用调试模式")
|
debug := flag.Bool("debug", false, "是否启用调试模式")
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
if *debug {
|
if *debug {
|
||||||
gin.SetMode(gin.DebugMode) // 启用调试模式
|
gin.SetMode(gin.DebugMode) // 启用调试模式
|
||||||
|
|||||||
Reference in New Issue
Block a user