dataset icon indicating copy to clipboard operation
dataset copied to clipboard

add structure.BodyFilename method

Open b5 opened this issue 6 years ago • 0 comments

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

b5 avatar May 16 '19 15:05 b5