Go module for appending files
func ExampleNewWriter() {
conf := config.Config{
PathTpl: "{dir}/{filename}{base_ext}{write_ext}",
BaseExt: ".msg",
WriteExt: "",
PathInfo: map[string]string{
"{dir}": os.Getenv("DIR"),
"{filename}": os.Getenv("FILENAME"),
},
UpdateMoment: "00:01:00",
}
writer := NewWriter("test-file", conf)
writer.Start()
writer.WriteString("this is string")
writer.WriteBytes([]byte("this is bytes"))
writer.Stop()
}