Golang 获取简单参数
package main import ( "flag" "fmt" ) func main() { flag.Parse() for _, param := range flag.Args() { fmt.Println(param) } data_path := flag.String("D", "/home/lee/workspace/databases", "DB data path") fmt.Println(*data_path) }
新的博客地址请访问:https://blog.imekaku.com/
package main import ( "flag" "fmt" ) func main() { flag.Parse() for _, param := range flag.Args() { fmt.Println(param) } data_path := flag.String("D", "/home/lee/workspace/databases", "DB data path") fmt.Println(*data_path) }
开始在上面输入您的搜索词,然后按回车进行搜索。按ESC取消。