MSP-6601 update linter settings, format code
This commit is contained in:
1 parent
421685bdef
commit
44a84e474d
3 files changed
+7
-3
No files matched your search
@@ -17,6 +17,7 @@ linters:
|
||||
- tagalign # не всегда имеет смысл
|
||||
- varnamelen # очень индивидуально (db)
|
||||
- wsl # расставление пробелов очень индивидуально
|
||||
- wsl_v5 # расставление пробелов очень индивидуально
|
||||
settings:
|
||||
cyclop:
|
||||
max-complexity: 15 # по умолчанию 10 мало
|
||||
|
||||
@@ -67,7 +67,8 @@ func (l Locker) Lock(ctx context.Context, key string, ttl int) (*domain.LockResp
|
||||
),
|
||||
)
|
||||
|
||||
if err := mtx.Lock(); err != nil {
|
||||
err := mtx.Lock()
|
||||
if err != nil {
|
||||
return nil, errors.WithMessagef(err, "fail lock. key=%s", key)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,13 +6,14 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"isp-lock-service/conf"
|
||||
"isp-lock-service/domain"
|
||||
|
||||
"github.com/go-redis/redis_rate/v10"
|
||||
"github.com/pkg/errors"
|
||||
goredislib "github.com/redis/go-redis/v9"
|
||||
"github.com/txix-open/isp-kit/log"
|
||||
"golang.org/x/time/rate"
|
||||
"isp-lock-service/conf"
|
||||
"isp-lock-service/domain"
|
||||
)
|
||||
|
||||
type RateLimiter struct {
|
||||
@@ -27,6 +28,7 @@ type RateLimiter struct {
|
||||
|
||||
type limiter struct {
|
||||
*rate.Limiter
|
||||
|
||||
lastUse time.Time
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user