I was in the middle of implementing a JSON-based vg/recorder.Canvas (b/c of go-hep/hep#982), looking at the code in vg/recorder.
when I noticed:
func (c*Canvas) append(aAction) {
ifc.c!=nil {
a.ApplyTo(c)
}
c.Actions=append(c.Actions, a)
}I think a.ApplyTo(c) should read a.ApplyTo(c.c).
right ?
but Canvas.c is never accessed (outside of Canvas.append, that is), and cannot be modified outside of vg/recorder.
so, couldn't we just get rid of this field ?
I was in the middle of implementing a JSON-based
vg/recorder.Canvas(b/c of go-hep/hep#982), looking at the code invg/recorder.when I noticed:
I think
a.ApplyTo(c)should reada.ApplyTo(c.c).right ?
but
Canvas.cis never accessed (outside ofCanvas.append, that is), and cannot be modified outside ofvg/recorder.so, couldn't we just get rid of this field ?