diff --git a/al2/web/albert_sites.go b/al2/web/albert_sites.go index b7fba55..0aaf4b7 100644 --- a/al2/web/albert_sites.go +++ b/al2/web/albert_sites.go @@ -2,15 +2,15 @@ package web import ( "encoding/json" + "io" "io/ioutil" - "os" "strings" ) type AlbertSites []*SiteConfig -func (a *AlbertSites) Decode(file *os.File) error { - b, err := ioutil.ReadAll(file) +func (a *AlbertSites) Decode(r io.ReadSeeker) error { + b, err := ioutil.ReadAll(r) if err != nil { return err } diff --git a/al2/web/alfred_sites.go b/al2/web/alfred_sites.go index e8e92b1..594c7d1 100644 --- a/al2/web/alfred_sites.go +++ b/al2/web/alfred_sites.go @@ -4,7 +4,7 @@ import ( "bytes" "github.com/DHowett/go-plist" "github.com/google/uuid" - "os" + "io" ) type CustomSites map[string]*SiteConfig @@ -12,8 +12,8 @@ type AlfredSites struct { CustomSites `plist:"customSites"` } -func (a *AlfredSites) Decode(file *os.File) error { - decoder := plist.NewDecoder(file) +func (a *AlfredSites) Decode(r io.ReadSeeker) error { + decoder := plist.NewDecoder(r) if err := decoder.Decode(a); err != nil { return err }