1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Use vanilla HTTP handlers (refactoring)

This commit is contained in:
Frédéric Guillot 2018-04-29 16:35:04 -07:00
parent 1eba1730d1
commit f49b42f70f
121 changed files with 4339 additions and 3369 deletions

View file

@ -12,14 +12,15 @@ import (
"github.com/miniflux/miniflux/model"
)
func decodeEntryStatusPayload(data io.Reader) (entryIDs []int64, status string, err error) {
func decodeEntryStatusPayload(r io.ReadCloser) (entryIDs []int64, status string, err error) {
type payload struct {
EntryIDs []int64 `json:"entry_ids"`
Status string `json:"status"`
}
var p payload
decoder := json.NewDecoder(data)
decoder := json.NewDecoder(r)
defer r.Close()
if err = decoder.Decode(&p); err != nil {
return nil, "", fmt.Errorf("invalid JSON payload: %v", err)
}