GOLANG学习32. 命令行参数获取
flag.StringVar(&confPath, “c”, “”, “please input confPath”)
flag.IntVar(&logLevel, “d”, 10, “please input log level”)
其实我一直在你身边
flag.StringVar(&confPath, “c”, “”, “please input confPath”)
flag.IntVar(&logLevel, “d”, 10, “please input log level”)
str, err := ioutil.ReadFile(“C:/test.txt”)
把文件内容读到内存里,再逐行读取
reader := bufio.NewReader(file)
str, _, err := reader.ReadLine()