Enforce use of any instead of interface{} (#30588)

Этот коммит содержится в:
Ben Schumacher
2025-03-31 10:44:34 +02:00
коммит произвёл GitHub
родитель 9aa4818c71
Коммит 166a676fe5
78 изменённых файлов: 268 добавлений и 262 удалений

Просмотреть файл

@@ -25,7 +25,7 @@ func NewBoolSetting(id, title, description, dependsOn string, store SettingStore
}
}
func (s *boolSetting) Set(userID string, value interface{}) error {
func (s *boolSetting) Set(userID string, value any) error {
boolValue := false
if value == TrueString {
boolValue = true
@@ -39,7 +39,7 @@ func (s *boolSetting) Set(userID string, value interface{}) error {
return nil
}
func (s *boolSetting) Get(userID string) (interface{}, error) {
func (s *boolSetting) Get(userID string) (any, error) {
value, err := s.store.GetSetting(userID, s.id)
if err != nil {
return "", err
@@ -79,7 +79,7 @@ func (s *boolSetting) GetSlackAttachments(userID, settingHandler string, disable
Name: "Yes",
Integration: &model.PostActionIntegration{
URL: settingHandler,
Context: map[string]interface{}{
Context: map[string]any{
ContextIDKey: s.id,
ContextButtonValueKey: TrueString,
},
@@ -91,7 +91,7 @@ func (s *boolSetting) GetSlackAttachments(userID, settingHandler string, disable
Name: "No",
Integration: &model.PostActionIntegration{
URL: settingHandler,
Context: map[string]interface{}{
Context: map[string]any{
ContextIDKey: s.id,
ContextButtonValueKey: FalseString,
},
@@ -111,6 +111,6 @@ func (s *boolSetting) GetSlackAttachments(userID, settingHandler string, disable
return &sa, nil
}
func (s *boolSetting) IsDisabled(foreignValue interface{}) bool {
func (s *boolSetting) IsDisabled(foreignValue any) bool {
return foreignValue == FalseString
}