Enforce use of any instead of interface{} (#30588)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9aa4818c71
Коммит
166a676fe5
@@ -9,8 +9,8 @@ import (
|
||||
var ErrNotFound = errors.New("not found")
|
||||
|
||||
type KVStore interface {
|
||||
Set(key string, value interface{}, options ...pluginapi.KVSetOption) (bool, error)
|
||||
Get(key string, o interface{}) error
|
||||
Set(key string, value any, options ...pluginapi.KVSetOption) (bool, error)
|
||||
Get(key string, o any) error
|
||||
Delete(key string) error
|
||||
DeleteAll() error
|
||||
ListKeys(page, count int, options ...pluginapi.ListKeysOption) ([]string, error)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package common
|
||||
|
||||
type LogAPI interface {
|
||||
LogError(message string, keyValuePairs ...interface{})
|
||||
LogWarn(message string, keyValuePairs ...interface{})
|
||||
LogInfo(message string, keyValuePairs ...interface{})
|
||||
LogDebug(message string, keyValuePairs ...interface{})
|
||||
LogError(message string, keyValuePairs ...any)
|
||||
LogWarn(message string, keyValuePairs ...any)
|
||||
LogInfo(message string, keyValuePairs ...any)
|
||||
LogDebug(message string, keyValuePairs ...any)
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func JSON(ref interface{}) string {
|
||||
func JSON(ref any) string {
|
||||
bb, _ := json.MarshalIndent(ref, "", " ")
|
||||
return string(bb)
|
||||
}
|
||||
@@ -17,6 +17,6 @@ func CodeBlock(in string) string {
|
||||
return fmt.Sprintf("\n```\n%s\n```\n", in)
|
||||
}
|
||||
|
||||
func JSONBlock(ref interface{}) string {
|
||||
func JSONBlock(ref any) string {
|
||||
return fmt.Sprintf("\n```json\n%s\n```\n", JSON(ref))
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user