diff --git a/internal/collections/infra/mysql_repo.go b/internal/collections/infra/mysql_repo.go index e45df0bd4..e069801b1 100644 --- a/internal/collections/infra/mysql_repo.go +++ b/internal/collections/infra/mysql_repo.go @@ -351,7 +351,7 @@ func (r mysqlRepo) reCountSubjectTags(ctx context.Context, tx *query.Query, phpTags = append(phpTags, subject.Tag{ Name: lo.ToPtr(name), Count: c, - TotalCount: uint(countMap[name]), + TotalCount: countMap[name], }) } diff --git a/internal/mocks/RedisCache.go b/internal/mocks/RedisCache.go index fce7469dd..1b4c791be 100644 --- a/internal/mocks/RedisCache.go +++ b/internal/mocks/RedisCache.go @@ -4,9 +4,11 @@ package mocks import ( context "context" - time "time" + rueidis "github.com/redis/rueidis" mock "github.com/stretchr/testify/mock" + + time "time" ) // RedisCache is an autogenerated mock type for the RedisCache type @@ -190,6 +192,53 @@ func (_c *RedisCache_Set_Call) RunAndReturn(run func(context.Context, string, in return _c } +// mget provides a mock function with given fields: ctx, key +func (_m *RedisCache) mget(ctx context.Context, key []string) rueidis.RedisResult { + ret := _m.Called(ctx, key) + + if len(ret) == 0 { + panic("no return value specified for mget") + } + + var r0 rueidis.RedisResult + if rf, ok := ret.Get(0).(func(context.Context, []string) rueidis.RedisResult); ok { + r0 = rf(ctx, key) + } else { + r0 = ret.Get(0).(rueidis.RedisResult) + } + + return r0 +} + +// RedisCache_mget_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'mget' +type RedisCache_mget_Call struct { + *mock.Call +} + +// mget is a helper method to define mock.On call +// - ctx context.Context +// - key []string +func (_e *RedisCache_Expecter) mget(ctx interface{}, key interface{}) *RedisCache_mget_Call { + return &RedisCache_mget_Call{Call: _e.mock.On("mget", ctx, key)} +} + +func (_c *RedisCache_mget_Call) Run(run func(ctx context.Context, key []string)) *RedisCache_mget_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]string)) + }) + return _c +} + +func (_c *RedisCache_mget_Call) Return(_a0 rueidis.RedisResult) *RedisCache_mget_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RedisCache_mget_Call) RunAndReturn(run func(context.Context, []string) rueidis.RedisResult) *RedisCache_mget_Call { + _c.Call.Return(run) + return _c +} + // NewRedisCache creates a new instance of RedisCache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewRedisCache(t interface {