package main
import
(
"flag"
"fmt"
)
func main(){
var user string
var password string
var hostname string
var port int
flag.StringVar(&user, "u","","用户名称")
flag.StringVar(&password, "p","","用户名称")
flag.StringVar(&hostname, "h","","用户名称")
flag.IntVar(&port, "P",3306,"用户名称")
flag.Parse()
fmt.Println(port)
}
Go获取命令行参数
最新推荐文章于 2024-03-06 21:27:47 发布