Golang tail包使用范例
用go读取日志文件package mainimport ( "fmt" "github.com/hpcloud/tail" "time")func main() { fileName := "./my.log" config := tail.Config{ ReOpen: true, Follow: true, Location: &tail.SeekInfo{Offset: 0, Whence: 2}, // 2表示从文件的末尾去读 MustExist: fa
原创
2021-07-06 02:02:44 ·
290 阅读 ·
0 评论