bebop / poly

A Go package for engineering organisms.
https://pkg.go.dev/github.com/bebop/poly
MIT License
665 stars 70 forks source link

Changed Build to use an io.Writer #334

Closed Koeng101 closed 1 year ago

Koeng101 commented 1 year ago

It was annoying me that fasta and fastq output to []byte and not an io.Writer. The io.Writer interface gives you access to a lot more - you can output over a websocket, to stdout, or to a file, without having to put the entire file into memory every time.

I would like to get comments on the error checking though - it is a little annoying, since every write technically can fail (like if the output location is cut off). I could just build everything into a huge Sprintf. The way I currently implement is naive and just uses a whole bunch of errs.