Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add structure.BodyFilename method #188

Open
b5 opened this issue May 16, 2019 · 0 comments
Open

add structure.BodyFilename method #188

b5 opened this issue May 16, 2019 · 0 comments
Labels
feat A code change that adds functionality

Comments

@b5
Copy link
Member

b5 commented May 16, 2019

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 b5 added the feat A code change that adds functionality label May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat A code change that adds functionality
Projects
None yet
Development

No branches or pull requests

1 participant