output file: missing '-' before timestamp

This commit is contained in:
gutmet 2020-11-04 23:37:26 +01:00
parent 7a262573d3
commit 0f22ab3e39

2
TDL.go
View File

@ -30,7 +30,7 @@ func outfile(infile string) io.Writer {
basename := path.Base(infile) basename := path.Base(infile)
extension := path.Ext(basename) extension := path.Ext(basename)
basename = strings.TrimSuffix(basename, extension) basename = strings.TrimSuffix(basename, extension)
name := basename + time.Now().Format(STAMP_FORMAT) + ".txt" name := basename + "-" + time.Now().Format(STAMP_FORMAT) + ".txt"
f, err := os.OpenFile(name, os.O_CREATE|os.O_WRONLY, 0644) f, err := os.OpenFile(name, os.O_CREATE|os.O_WRONLY, 0644)
if err != nil { if err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)