0xmichalis / chiapos

🍃 Chia's initial Proof of Space implementation
Other
26 stars 9 forks source link

why? afero change to NewMemMapFs very slowly? #20

Open chengjia2016 opened 3 years ago

chengjia2016 commented 3 years ago

package fs

import ( "fmt"

"github.com/spf13/afero"

)

const ( OsType = "os" Mem = "mem" )

var supportedTypes = []string{OsType}

func GetFs(fs string) (afero.Fs, error) { switch fs { case OsType: return afero.NewOsFs(), nil case Mem: return afero.NewMemMapFs(), nil } return nil, fmt.Errorf("unknown filesystem type provided: %s (supported types: %v)", fs, supportedTypes) }