* replace interface{} with any
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-07-05 09:46:50 +03:00
коммит произвёл GitHub
родитель b45ff0be5d
Коммит 717a4d04a9
258 изменённых файлов: 1286 добавлений и 1286 удалений

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

@@ -20,7 +20,7 @@ func (r *Response) IsSuccess() bool {
}
// SetPayload serializes an arbitrary struct as a RawMessage.
func (r *Response) SetPayload(v interface{}) error {
func (r *Response) SetPayload(v any) error {
raw, err := json.Marshal(v)
if err != nil {
return err

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

@@ -12,7 +12,7 @@ import (
//
// There are a number of send channels (`MaxConcurrentSends`) to allow for sending to multiple
// remotes concurrently, while preserving message order for each remote.
func (rcs *Service) enqueueTask(ctx context.Context, remoteId string, task interface{}) error {
func (rcs *Service) enqueueTask(ctx context.Context, remoteId string, task any) error {
if ctx == nil {
ctx = context.Background()
}

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

@@ -79,7 +79,7 @@ type ConnectionStateListener func(rc *model.RemoteCluster, online bool)
type Service struct {
server ServerIface
httpClient *http.Client
send []chan interface{}
send []chan any
// everything below guarded by `mux`
mux sync.RWMutex
@@ -120,9 +120,9 @@ func NewRemoteClusterService(server ServerIface) (*Service, error) {
connectionStateListeners: make(map[string]ConnectionStateListener),
}
service.send = make([]chan interface{}, MaxConcurrentSends)
service.send = make([]chan any, MaxConcurrentSends)
for i := range service.send {
service.send[i] = make(chan interface{}, SendChanBuffer)
service.send[i] = make(chan any, SendChanBuffer)
}
return service, nil