Fixed a few linter hints

This commit is contained in:
2019-06-07 10:03:16 +09:00
parent 0e4f7fe6ec
commit f464e830bf
21 changed files with 52 additions and 29 deletions

View File

@ -15,5 +15,5 @@ func Redirect(ctx aero.Context) error {
return ctx.Error(http.StatusUnauthorized, "Not logged in")
}
return ctx.Redirect(http.StatusTemporaryRedirect, "/+" + user.Nick + ctx.Path())
return ctx.Redirect(http.StatusTemporaryRedirect, "/+"+user.Nick+ctx.Path())
}

View File

@ -2,8 +2,8 @@ package editor
import (
"github.com/akyoto/hash"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/mal"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/notify.moe/utils"
"github.com/animenotifier/notify.moe/utils/animediff"
)

View File

@ -4,8 +4,8 @@ import (
"sort"
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/kitsu"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/utils"
)

View File

@ -6,8 +6,8 @@ import (
"github.com/animenotifier/notify.moe/utils/animediff"
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/mal"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/utils"
)
@ -122,7 +122,8 @@ func compare(animes []*arn.Anime) []*utils.MALComparison {
// diff returns all the differences between an anime and its MAL counterpart.
func diff(anime *arn.Anime, malAnime *mal.Anime) []animediff.Difference {
// nolint (prealloc linter would complain, but this is best left as nil by default)
// Prealloc linter would complain, but this is best left as nil by default.
// nolint:prealloc
var differences []animediff.Difference
// We'll use the following diffs

View File

@ -6,8 +6,8 @@ import (
"net/http"
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/kitsu"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/utils"
)

View File

@ -7,8 +7,8 @@ import (
"strconv"
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/mal"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/utils"
)

View File

@ -47,11 +47,12 @@ func Anime(ctx aero.Context) error {
continue
}
if anime.Type == "tv" {
switch anime.Type {
case "tv":
tv = append(tv, anime)
} else if anime.Type == "movie" {
case "movie":
movies = append(movies, anime)
} else {
default:
continue
}

View File

@ -1,7 +1,7 @@
package upload
// We need these to decode uploaded images.
import (
// We need these to decode uploaded images.
_ "image/gif"
_ "image/jpeg"
_ "image/png"