cleanup sqlite module
2 files changed, 3 insertions(+), 6 deletions(-)
M internal/storage/sqlite/file.go → internal/storage/sqlite/file.go
@@ -13,9 +13,7 @@ return pathname } func cleanPathName(pathname string) string { - if strings.HasSuffix(pathname, ".html") { - pathname = strings.TrimSuffix(pathname, ".html") - } + pathname = strings.TrimSuffix(pathname, ".html") return pathname }
M internal/storage/sqlite/writer.go → internal/storage/sqlite/writer.go
@@ -110,12 +110,11 @@ Title: file.Title, Headers: []byte{}, } if file.Headers != nil { - jso, err := json.Marshal(file.Headers) + var err error + params.Headers, err = json.Marshal(file.Headers) if err != nil { return 0, fault.Wrap(err, fmsg.With("marshalling headers to JSON")) } - params.Headers = jso - s.log.Info("storing file", "file", file.Path, "headers", params.Headers) } id, err := s.queries.InsertFile(context.TODO(), params) if err != nil {