Enforce use of any instead of interface{} (#30588)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9aa4818c71
Коммит
166a676fe5
@@ -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
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user