dataset
dataset copied to clipboard
add structure.BodyFilename method
In lots of places I end up generating a body file on the spot from a stream of data & a structure:
qfs.NewMemfileBytes(fmt.Sprintf("body.%s", ds.Structure.Format), w.Bytes())
I think this could be composed a little nicer, to something like:
body := qfs.NewMemfileReader(ds.Structure.BodyFilename(), r)
For that we'd need something like:
func (st *Structure) BodyFilename() string {
return fmt.Sprintf("body.%s", ds.Structure.Format)
}
it's a small win, but would produce more consistency across the codebase