mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update golangci-lint config
This commit is contained in:
@@ -2,10 +2,11 @@ package telegram
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (b *Bot) downloadAttachment(ctx context.Context, message *Message) (*Attachment, error) {
|
||||
@@ -92,13 +93,13 @@ func (b *Bot) downloadFilepath(ctx context.Context, filePath string) ([]byte, er
|
||||
|
||||
resp, err := http.Get(fileURL + "/" + filePath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("fail to http.Get: %s", err)
|
||||
return nil, errors.Wrap(err, "fail to http.Get")
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("fail to io.ReadAll: %s", err)
|
||||
return nil, errors.Wrap(err, "fail to io.ReadAll")
|
||||
}
|
||||
|
||||
return body, nil
|
||||
|
Reference in New Issue
Block a user