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:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
|
||||
"github.com/usememos/memos/common/util"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/usememos/memos/server/version"
|
||||
)
|
||||
|
||||
@@ -46,7 +48,7 @@ func checkDSN(dataDir string) (string, error) {
|
||||
dataDir = strings.TrimRight(dataDir, "\\/")
|
||||
|
||||
if _, err := os.Stat(dataDir); err != nil {
|
||||
return "", fmt.Errorf("unable to access data folder %s, err %w", dataDir, err)
|
||||
return "", errors.Wrapf(err, "unable to access data folder %s", dataDir)
|
||||
}
|
||||
|
||||
return dataDir, nil
|
||||
|
||||
@@ -14,6 +14,8 @@ import (
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
"github.com/pkg/errors"
|
||||
echoSwagger "github.com/swaggo/echo-swagger"
|
||||
"go.uber.org/zap"
|
||||
|
||||
apiv1 "github.com/usememos/memos/api/v1"
|
||||
apiv2 "github.com/usememos/memos/api/v2"
|
||||
"github.com/usememos/memos/common/log"
|
||||
@@ -21,7 +23,6 @@ import (
|
||||
"github.com/usememos/memos/server/profile"
|
||||
"github.com/usememos/memos/server/service"
|
||||
"github.com/usememos/memos/store"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
@@ -89,7 +90,7 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
|
||||
|
||||
serverID, err := s.getSystemServerID(ctx)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to retrieve system server ID: %w", err)
|
||||
return nil, errors.Wrap(err, "failed to retrieve system server ID")
|
||||
}
|
||||
s.ID = serverID
|
||||
|
||||
@@ -105,7 +106,7 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
|
||||
if profile.Mode == "prod" {
|
||||
secret, err = s.getSystemSecretSessionName(ctx)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to retrieve system secret session name: %w", err)
|
||||
return nil, errors.Wrap(err, "failed to retrieve system secret session name")
|
||||
}
|
||||
}
|
||||
s.Secret = secret
|
||||
@@ -117,7 +118,7 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
|
||||
s.apiV2Service = apiv2.NewAPIV2Service(s.Secret, profile, store, s.Profile.Port+1)
|
||||
// Register gRPC gateway as api v2.
|
||||
if err := s.apiV2Service.RegisterGateway(ctx, e); err != nil {
|
||||
return nil, fmt.Errorf("failed to register gRPC gateway: %w", err)
|
||||
return nil, errors.Wrap(err, "failed to register gRPC gateway")
|
||||
}
|
||||
|
||||
return s, nil
|
||||
|
||||
@@ -6,10 +6,11 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
apiv1 "github.com/usememos/memos/api/v1"
|
||||
"github.com/usememos/memos/common/log"
|
||||
"github.com/usememos/memos/store"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
type BackupRunner struct {
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"unicode/utf16"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
apiv1 "github.com/usememos/memos/api/v1"
|
||||
"github.com/usememos/memos/plugin/telegram"
|
||||
"github.com/usememos/memos/store"
|
||||
@@ -34,7 +35,7 @@ const (
|
||||
func (t *telegramHandler) MessageHandle(ctx context.Context, bot *telegram.Bot, message telegram.Message, attachments []telegram.Attachment) error {
|
||||
reply, err := bot.SendReplyMessage(ctx, message.Chat.ID, message.MessageID, workingMessage)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Failed to SendReplyMessage: %s", err)
|
||||
return errors.Wrap(err, "Failed to SendReplyMessage")
|
||||
}
|
||||
|
||||
var creatorID int32
|
||||
|
||||
Reference in New Issue
Block a user