update golangci lint linter list

This commit is contained in:
sentriz
2020-05-02 04:22:26 +01:00
parent fc6f39bbfe
commit b02ade3415
14 changed files with 53 additions and 31 deletions

View File

@@ -2,6 +2,7 @@ package ctrladmin
import (
"bufio"
"errors"
"fmt"
"mime/multipart"
"net/http"
@@ -12,6 +13,10 @@ import (
"go.senan.xyz/gonic/server/db"
)
var (
errPlaylistNoMatch = errors.New("couldn't match track")
)
func playlistParseLine(c *Controller, path string) (int, error) {
if strings.HasPrefix(path, "#") || strings.TrimSpace(path) == "" {
return 0, nil
@@ -25,7 +30,7 @@ func playlistParseLine(c *Controller, path string) (int, error) {
err := query.First(&track).Error
switch {
case gorm.IsRecordNotFoundError(err):
return 0, fmt.Errorf("couldn't match track %q", path)
return 0, fmt.Errorf("%v: %w", err, errPlaylistNoMatch)
case err != nil:
return 0, fmt.Errorf("while matching: %w", err)
default: