keithknott26/datadash

it always panic

Opened this issue · 2 comments

it always panic

$ seq 4000 | awk 'BEGIN{OFS="\t"; print "x","sin(x)","cos(x)", "rand(x)", "rand(x)", "rand(x)"}{x=$1/10; print x,sin(x),cos(x),rand(x),rand(x),rand(x); system("sleep 0.02")}'  | ./datadash
$ seq 4000 | awk 'BEGIN{OFS="\t"; print "x","sin(x)"}{x=$1/10; print x,sin(x); system("sleep 0.02")}'  | ./datadash --label-mode time
goroutine 65 [running]:
github.com/keithknott26/datadash.periodic(0x12fd8c0, 0xc00010e0c0, 0x2625a00, 0xc0001904e0)
	/Users/eric/go/src/github.com/keithknott26/datadash/row.go:589 +0x17b
created by github.com/keithknott26/datadash.(*Row).createSparkLine
	/Users/eric/go/src/github.com/keithknott26/datadash/row.go:392 +0x12e

Clem- commented

Same issue with samples provided in the repo. It seems to occur as soon as the file/stream is at the end.

I managed to get rid of this issue by commenting this line.

@beaquant while not an ideal fix, i've committed the suggested change to the repo, and thanks for your help @Clem- .