updated dependencies and golangci-lint to v2
This commit is contained in:
@@ -66,7 +66,7 @@ func (p *Twitch) FetchAuthUser(token *oauth2.Token) (*AuthUser, error) {
|
||||
}
|
||||
|
||||
if len(extracted.Data) == 0 {
|
||||
return nil, errors.New("Failed to fetch AuthUser data")
|
||||
return nil, errors.New("failed to fetch AuthUser data")
|
||||
}
|
||||
|
||||
user := &AuthUser{
|
||||
|
||||
@@ -653,7 +653,7 @@ func (w *writer) Close() error {
|
||||
|
||||
// Always delete the temp file. On success, it will have been renamed so
|
||||
// the Remove will fail.
|
||||
tempname := w.File.Name()
|
||||
tempname := w.Name()
|
||||
defer os.Remove(tempname)
|
||||
|
||||
// Check if the write was cancelled.
|
||||
|
||||
@@ -95,5 +95,5 @@ func findSendmailPath() (string, error) {
|
||||
}
|
||||
}
|
||||
|
||||
return "", errors.New("Failed to locate a sendmail executable path.")
|
||||
return "", errors.New("failed to locate a sendmail executable path")
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ func (r *SimpleFieldResolver) UpdateQuery(query *dbx.SelectQuery) error {
|
||||
// Returns error if `field` is not in `r.allowedFields`.
|
||||
func (r *SimpleFieldResolver) Resolve(field string) (*ResolverResult, error) {
|
||||
if !list.ExistInSliceWithRegex(field, r.allowedFields) {
|
||||
return nil, fmt.Errorf("Failed to resolve field %q.", field)
|
||||
return nil, fmt.Errorf("failed to resolve field %q", field)
|
||||
}
|
||||
|
||||
parts := strings.Split(field, ".")
|
||||
|
||||
@@ -142,9 +142,10 @@ func (t *Tokenizer) readToken() (string, error) {
|
||||
} else if !t.ignoreParenthesis && ch == ')' && parenthesis > 0 && quoteCh == eof {
|
||||
parenthesis-- // closing parenthesis
|
||||
} else if t.isQuoteRune(ch) {
|
||||
if quoteCh == ch {
|
||||
switch quoteCh {
|
||||
case ch:
|
||||
quoteCh = eof // closing quote
|
||||
} else if quoteCh == eof {
|
||||
case eof:
|
||||
quoteCh = ch // opening quote
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ func (m *JSONArray[T]) Scan(value any) error {
|
||||
case string:
|
||||
data = []byte(v)
|
||||
default:
|
||||
return fmt.Errorf("Failed to unmarshal JSONArray value: %q.", value)
|
||||
return fmt.Errorf("failed to unmarshal JSONArray value: %q", value)
|
||||
}
|
||||
|
||||
if len(data) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user