func stdinToBytes(file io.Reader) []byte {
	var stringBuffer bytes.Buffer
	reader := bufio.NewReader(file)
	for {
		input, _, err := reader.ReadRune()
		if err != nil && err == io.EOF {
			break
		}
		stringBuffer.WriteRune(input)
	}
	return stringBuffer.Bytes()
}
a simple helper function to convert an *os.File type into a string.
package main
import (
	"bufio"
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"os"
	"path/filepath"
	"sync"
	"github.com/TimothyStiles/poly/io/genbank"
	"github.com/TimothyStiles/poly/io/gff"
	"github.com/TimothyStiles/poly/io/poly"
	"github.com/TimothyStiles/poly/io/polyjson"
	"github.com/TimothyStiles/poly/seqhash"
	"github.com/urfave/cli/v2"
)
var errIllegalInputFlag error = errors.New("the '-i' flag can only be used with pipes")
func convertCommand(c *cli.Context) error {
	if isPipe(c) {
		sequence := parseStdin(c)
		output := buildStdOut(c, sequence)
		fmt.Fprint(c.App.Writer, string(output))
	} else {
		if c.String("i") != "" {
			return errIllegalInputFlag
		}
		matches := getMatches(c)
		var wg sync.WaitGroup
		for _, match := range matches {
			wg.Add(1)
			go func(match string) {
				sequence := parseExt(match)
				writeFile(c, sequence, match)
				wg.Done()
			}(match)  
		}
		wg.Wait()
	}
	return nil
}
func hashCommand(c *cli.Context) error {
	if isPipe(c) {
		sequence := parseStdin(c)  
		hash, _ := seqhash.Hash(sequence.Sequence, sequence.Meta.Locus.MoleculeType, sequence.Meta.Locus.Circular, true)
		printHash(c, hash, "-")
	} else {
		if c.String("i") != "" {
			return errIllegalInputFlag
		}
		matches := getMatches(c)
		var wg sync.WaitGroup
		for _, match := range matches {
			wg.Add(1)
			go func(match string) {
				sequence := parseExt(match)
				hash, _ := seqhash.Hash(sequence.Sequence, sequence.Meta.Locus.MoleculeType, sequence.Meta.Locus.Circular, true)
				printHash(c, hash, match)
				wg.Done()
			}(match)  
		}
		wg.Wait()
	}
	return nil
}