Skip to content

Commit

Permalink
Linting fixes (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschfh authored Dec 12, 2024
1 parent 9e83afe commit 75c6206
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cache/instrumented_redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (_d RedisClientWithPrometheus) FlushAll(ctx context.Context) (err error) {
}

// Get implements RedisClient
func (_d RedisClientWithPrometheus) Get(ctx context.Context, key string, delete bool) (s1 string, err error) {
func (_d RedisClientWithPrometheus) Get(ctx context.Context, key string, deleteAfterGet bool) (s1 string, err error) {
_since := time.Now()
defer func() {
result := "ok"
Expand All @@ -77,7 +77,7 @@ func (_d RedisClientWithPrometheus) Get(ctx context.Context, key string, delete

redisclientDurationSummaryVec.WithLabelValues(_d.instanceName, "Get", result).Observe(time.Since(_since).Seconds())
}()
return _d.base.Get(ctx, key, delete)
return _d.base.Get(ctx, key, deleteAfterGet)
}

// Set implements RedisClient
Expand Down
10 changes: 5 additions & 5 deletions cache/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
type RedisClient interface {
Set(ctx context.Context, key string, val string, ttl time.Duration) error
Incr(ctx context.Context, key string, subtract bool) (int, error)
Get(ctx context.Context, key string, delete bool) (string, error)
Get(ctx context.Context, key string, deleteAfterGet bool) (string, error)
Del(ctx context.Context, keys ...string) error
FlushAll(ctx context.Context) error
}
Expand Down Expand Up @@ -78,9 +78,9 @@ func (r *redisSimpleClient) Incr(ctx context.Context, key string, subtract bool)
return int(val), err
}

func (r *redisSimpleClient) Get(ctx context.Context, key string, delete bool) (string, error) {
func (r *redisSimpleClient) Get(ctx context.Context, key string, deleteAfterGet bool) (string, error) {
var res *redis.StringCmd
if delete {
if deleteAfterGet {
res = r.client.GetDel(ctx, key)
} else {
res = r.client.Get(ctx, key)
Expand Down Expand Up @@ -115,9 +115,9 @@ func (r *redisClusterClient) Incr(ctx context.Context, key string, subtract bool
return int(val), err
}

func (r *redisClusterClient) Get(ctx context.Context, key string, delete bool) (string, error) {
func (r *redisClusterClient) Get(ctx context.Context, key string, deleteAfterGet bool) (string, error) {
var res *redis.StringCmd
if delete {
if deleteAfterGet {
res = r.client.GetDel(ctx, key)
} else {
res = r.client.Get(ctx, key)
Expand Down
2 changes: 1 addition & 1 deletion datastore/datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Datastore interface {
// Insert a series of sync entities in a write transaction.
InsertSyncEntitiesWithServerTags(entities []*SyncEntity) error
// Update an existing sync entity.
UpdateSyncEntity(entity *SyncEntity, oldVersion int64) (conflict bool, delete bool, err error)
UpdateSyncEntity(entity *SyncEntity, oldVersion int64) (conflict bool, deleted bool, err error)
// Get updates for a specific type which are modified after the time of
// client token for a given client. Besides the array of sync entities, a
// boolean value indicating whether there are more updates to query in the
Expand Down
2 changes: 1 addition & 1 deletion datastore/datastoretest/mock_datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (m *MockDatastore) InsertSyncEntitiesWithServerTags(entities []*datastore.S
}

// UpdateSyncEntity mocks calls to UpdateSyncEntity
func (m *MockDatastore) UpdateSyncEntity(entity *datastore.SyncEntity, oldVersion int64) (conflict bool, delete bool, err error) {
func (m *MockDatastore) UpdateSyncEntity(entity *datastore.SyncEntity, oldVersion int64) (conflict bool, deleted bool, err error) {
args := m.Called(entity, oldVersion)
return args.Bool(0), args.Bool(1), args.Error(2)
}
Expand Down
2 changes: 1 addition & 1 deletion datastore/instrumented_datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (_d DatastoreWithPrometheus) UpdateClientItemCount(counts *ClientItemCounts
}

// UpdateSyncEntity implements Datastore
func (_d DatastoreWithPrometheus) UpdateSyncEntity(entity *SyncEntity, oldVersion int64) (conflict bool, delete bool, err error) {
func (_d DatastoreWithPrometheus) UpdateSyncEntity(entity *SyncEntity, oldVersion int64) (conflict bool, deleted bool, err error) {
_since := time.Now()
defer func() {
result := "ok"
Expand Down

0 comments on commit 75c6206

Please sign in to comment.