update golangci lint linter list
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user