Files
0d847ef67c Upgrade Go to 1.24.3 (#31220)
* Upgrade Go to 1.24.3

Updates the following files:
- server/.go-version: 1.23.9 → 1.24.3
- server/build/Dockerfile.buildenv: golang:1.23.9-bullseye → golang:1.24.3-bullseye
- server/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3
- server/public/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3

Also fixes non-constant format string errors introduced by Go 1.24.3's stricter format string checking:
- Added response() helper function in slashcommands/util.go for simple string responses
- Removed unused responsef() function from slashcommands/util.go
- Replaced responsef() with response() for translated strings that don't need formatting
- Fixed fmt.Errorf and fmt.Fprintf calls to use proper format verbs instead of string concatenation
- Updated marketplace buildURL to handle format strings conditionally

* Update generated mocks for Go 1.24.3

Regenerated mocks using mockery v2.53.4 to ensure compatibility with Go 1.24.3.
This addresses mock generation failures that occurred with the Go upgrade.

* Update to bookworm and fix non-existent sha

Signed-off-by: Stavros Foteinopoulos <[email protected]>

* fix non-constant format string

---------

Signed-off-by: Stavros Foteinopoulos <[email protected]>

Co-authored-by: Stavros Foteinopoulos <[email protected]>

Co-authored-by: Hanzo Dev <[email protected]>
2025-06-10 15:04:57 -03:00

358 lines
8.8 KiB
Go

// Code generated by mockery v2.53.4. DO NOT EDIT.
// Regenerate this file using `make store-mocks`.
package mocks
import (
model "github.com/mattermost/mattermost/server/public/model"
mock "github.com/stretchr/testify/mock"
)
// ReactionStore is an autogenerated mock type for the ReactionStore type
type ReactionStore struct {
mock.Mock
}
// BulkGetForPosts provides a mock function with given fields: postIds
func (_m *ReactionStore) BulkGetForPosts(postIds []string) ([]*model.Reaction, error) {
ret := _m.Called(postIds)
if len(ret) == 0 {
panic("no return value specified for BulkGetForPosts")
}
var r0 []*model.Reaction
var r1 error
if rf, ok := ret.Get(0).(func([]string) ([]*model.Reaction, error)); ok {
return rf(postIds)
}
if rf, ok := ret.Get(0).(func([]string) []*model.Reaction); ok {
r0 = rf(postIds)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.Reaction)
}
}
if rf, ok := ret.Get(1).(func([]string) error); ok {
r1 = rf(postIds)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Delete provides a mock function with given fields: reaction
func (_m *ReactionStore) Delete(reaction *model.Reaction) (*model.Reaction, error) {
ret := _m.Called(reaction)
if len(ret) == 0 {
panic("no return value specified for Delete")
}
var r0 *model.Reaction
var r1 error
if rf, ok := ret.Get(0).(func(*model.Reaction) (*model.Reaction, error)); ok {
return rf(reaction)
}
if rf, ok := ret.Get(0).(func(*model.Reaction) *model.Reaction); ok {
r0 = rf(reaction)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Reaction)
}
}
if rf, ok := ret.Get(1).(func(*model.Reaction) error); ok {
r1 = rf(reaction)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// DeleteAllWithEmojiName provides a mock function with given fields: emojiName
func (_m *ReactionStore) DeleteAllWithEmojiName(emojiName string) error {
ret := _m.Called(emojiName)
if len(ret) == 0 {
panic("no return value specified for DeleteAllWithEmojiName")
}
var r0 error
if rf, ok := ret.Get(0).(func(string) error); ok {
r0 = rf(emojiName)
} else {
r0 = ret.Error(0)
}
return r0
}
// DeleteOrphanedRowsByIds provides a mock function with given fields: r
func (_m *ReactionStore) DeleteOrphanedRowsByIds(r *model.RetentionIdsForDeletion) (int64, error) {
ret := _m.Called(r)
if len(ret) == 0 {
panic("no return value specified for DeleteOrphanedRowsByIds")
}
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func(*model.RetentionIdsForDeletion) (int64, error)); ok {
return rf(r)
}
if rf, ok := ret.Get(0).(func(*model.RetentionIdsForDeletion) int64); ok {
r0 = rf(r)
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func(*model.RetentionIdsForDeletion) error); ok {
r1 = rf(r)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ExistsOnPost provides a mock function with given fields: postID, emojiName
func (_m *ReactionStore) ExistsOnPost(postID string, emojiName string) (bool, error) {
ret := _m.Called(postID, emojiName)
if len(ret) == 0 {
panic("no return value specified for ExistsOnPost")
}
var r0 bool
var r1 error
if rf, ok := ret.Get(0).(func(string, string) (bool, error)); ok {
return rf(postID, emojiName)
}
if rf, ok := ret.Get(0).(func(string, string) bool); ok {
r0 = rf(postID, emojiName)
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func(string, string) error); ok {
r1 = rf(postID, emojiName)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetForPost provides a mock function with given fields: postID, allowFromCache
func (_m *ReactionStore) GetForPost(postID string, allowFromCache bool) ([]*model.Reaction, error) {
ret := _m.Called(postID, allowFromCache)
if len(ret) == 0 {
panic("no return value specified for GetForPost")
}
var r0 []*model.Reaction
var r1 error
if rf, ok := ret.Get(0).(func(string, bool) ([]*model.Reaction, error)); ok {
return rf(postID, allowFromCache)
}
if rf, ok := ret.Get(0).(func(string, bool) []*model.Reaction); ok {
r0 = rf(postID, allowFromCache)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.Reaction)
}
}
if rf, ok := ret.Get(1).(func(string, bool) error); ok {
r1 = rf(postID, allowFromCache)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetForPostSince provides a mock function with given fields: postID, since, excludeRemoteID, inclDeleted
func (_m *ReactionStore) GetForPostSince(postID string, since int64, excludeRemoteID string, inclDeleted bool) ([]*model.Reaction, error) {
ret := _m.Called(postID, since, excludeRemoteID, inclDeleted)
if len(ret) == 0 {
panic("no return value specified for GetForPostSince")
}
var r0 []*model.Reaction
var r1 error
if rf, ok := ret.Get(0).(func(string, int64, string, bool) ([]*model.Reaction, error)); ok {
return rf(postID, since, excludeRemoteID, inclDeleted)
}
if rf, ok := ret.Get(0).(func(string, int64, string, bool) []*model.Reaction); ok {
r0 = rf(postID, since, excludeRemoteID, inclDeleted)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*model.Reaction)
}
}
if rf, ok := ret.Get(1).(func(string, int64, string, bool) error); ok {
r1 = rf(postID, since, excludeRemoteID, inclDeleted)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetSingle provides a mock function with given fields: userID, postID, remoteID, emojiName
func (_m *ReactionStore) GetSingle(userID string, postID string, remoteID string, emojiName string) (*model.Reaction, error) {
ret := _m.Called(userID, postID, remoteID, emojiName)
if len(ret) == 0 {
panic("no return value specified for GetSingle")
}
var r0 *model.Reaction
var r1 error
if rf, ok := ret.Get(0).(func(string, string, string, string) (*model.Reaction, error)); ok {
return rf(userID, postID, remoteID, emojiName)
}
if rf, ok := ret.Get(0).(func(string, string, string, string) *model.Reaction); ok {
r0 = rf(userID, postID, remoteID, emojiName)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Reaction)
}
}
if rf, ok := ret.Get(1).(func(string, string, string, string) error); ok {
r1 = rf(userID, postID, remoteID, emojiName)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetUniqueCountForPost provides a mock function with given fields: postID
func (_m *ReactionStore) GetUniqueCountForPost(postID string) (int, error) {
ret := _m.Called(postID)
if len(ret) == 0 {
panic("no return value specified for GetUniqueCountForPost")
}
var r0 int
var r1 error
if rf, ok := ret.Get(0).(func(string) (int, error)); ok {
return rf(postID)
}
if rf, ok := ret.Get(0).(func(string) int); ok {
r0 = rf(postID)
} else {
r0 = ret.Get(0).(int)
}
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(postID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PermanentDeleteBatch provides a mock function with given fields: endTime, limit
func (_m *ReactionStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, error) {
ret := _m.Called(endTime, limit)
if len(ret) == 0 {
panic("no return value specified for PermanentDeleteBatch")
}
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func(int64, int64) (int64, error)); ok {
return rf(endTime, limit)
}
if rf, ok := ret.Get(0).(func(int64, int64) int64); ok {
r0 = rf(endTime, limit)
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func(int64, int64) error); ok {
r1 = rf(endTime, limit)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// PermanentDeleteByUser provides a mock function with given fields: userID
func (_m *ReactionStore) PermanentDeleteByUser(userID string) error {
ret := _m.Called(userID)
if len(ret) == 0 {
panic("no return value specified for PermanentDeleteByUser")
}
var r0 error
if rf, ok := ret.Get(0).(func(string) error); ok {
r0 = rf(userID)
} else {
r0 = ret.Error(0)
}
return r0
}
// Save provides a mock function with given fields: reaction
func (_m *ReactionStore) Save(reaction *model.Reaction) (*model.Reaction, error) {
ret := _m.Called(reaction)
if len(ret) == 0 {
panic("no return value specified for Save")
}
var r0 *model.Reaction
var r1 error
if rf, ok := ret.Get(0).(func(*model.Reaction) (*model.Reaction, error)); ok {
return rf(reaction)
}
if rf, ok := ret.Get(0).(func(*model.Reaction) *model.Reaction); ok {
r0 = rf(reaction)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.Reaction)
}
}
if rf, ok := ret.Get(1).(func(*model.Reaction) error); ok {
r1 = rf(reaction)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewReactionStore creates a new instance of ReactionStore. 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 NewReactionStore(t interface {
mock.TestingT
Cleanup(func())
}) *ReactionStore {
mock := &ReactionStore{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}