mirror of
https://github.com/miniflux/v2.git
synced 2025-08-16 18:01:37 +00:00
Make sure golint pass on the code base
This commit is contained in:
parent
8781648af9
commit
bb8e61c7c5
59 changed files with 322 additions and 171 deletions
|
@ -92,7 +92,7 @@ func (h *Handler) CreateFeed(userID, categoryID int64, url string) (*model.Feed,
|
|||
func (h *Handler) RefreshFeed(userID, feedID int64) error {
|
||||
defer helper.ExecutionTime(time.Now(), fmt.Sprintf("[Handler:RefreshFeed] feedID=%d", feedID))
|
||||
|
||||
originalFeed, err := h.store.GetFeedById(userID, feedID)
|
||||
originalFeed, err := h.store.FeedByID(userID, feedID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ type Handler struct {
|
|||
|
||||
// Export exports user feeds to OPML.
|
||||
func (h *Handler) Export(userID int64) (string, error) {
|
||||
feeds, err := h.store.GetFeeds(userID)
|
||||
feeds, err := h.store.Feeds(userID)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return "", errors.New("unable to fetch feeds")
|
||||
|
@ -52,13 +52,13 @@ func (h *Handler) Import(userID int64, data io.Reader) (err error) {
|
|||
var category *model.Category
|
||||
|
||||
if subscription.CategoryName == "" {
|
||||
category, err = h.store.GetFirstCategory(userID)
|
||||
category, err = h.store.FirstCategory(userID)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return errors.New("unable to find first category")
|
||||
}
|
||||
} else {
|
||||
category, err = h.store.GetCategoryByTitle(userID, subscription.CategoryName)
|
||||
category, err = h.store.CategoryByTitle(userID, subscription.CategoryName)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return errors.New("unable to search category by title")
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/miniflux/miniflux2/reader/sanitizer"
|
||||
)
|
||||
|
||||
// ItemContentProcessor executes a set of functions to sanitize and alter item contents.
|
||||
func ItemContentProcessor(url, content string) string {
|
||||
content = sanitizer.Sanitize(url, content)
|
||||
return rewrite.Rewriter(url, content)
|
||||
|
|
|
@ -38,6 +38,7 @@ var rewriteRules = []func(string, string) string{
|
|||
},
|
||||
}
|
||||
|
||||
// Rewriter modify item contents with a set of rewriting rules.
|
||||
func Rewriter(url, content string) string {
|
||||
for _, rewriteRule := range rewriteRules {
|
||||
content = rewriteRule(url, content)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue