From 1d23c6b87b8c12df53f83efb461ff73f1a0cdc23 Mon Sep 17 00:00:00 2001 From: Mark Bates Date: Wed, 31 Jul 2019 13:58:20 -0400 Subject: [PATCH] windows are broken --- file.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/file.go b/file.go index bba494e..382dd54 100644 --- a/file.go +++ b/file.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "net/http" "os" "time" @@ -29,6 +30,14 @@ func (f File) MarshalJSON() ([]byte, error) { m["her"] = f.her m["path"] = f.path m["index"] = f.index + m["data"] = f.data + if len(f.data) == 0 { + b, err := ioutil.ReadAll(&f) + if err != nil { + return nil, err + } + m["data"] = b + } return json.Marshal(m) }