diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 720a6180..794407b0 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -13,11 +13,11 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 # action page: with: - go-version: 1.18 + go-version: 1.19 - name: Run linter uses: golangci/golangci-lint-action@v3.2.0 # Action page: with: - version: v1.47 # without patch version + version: v1.48 # without patch version only-new-issues: false # show only new issues if it's a pull request args: --timeout=10m --build-tags=safe diff --git a/aggregatedpool/handler.go b/aggregatedpool/handler.go index beb4461b..c1662ae4 100644 --- a/aggregatedpool/handler.go +++ b/aggregatedpool/handler.go @@ -346,7 +346,7 @@ func (wp *Workflow) flushQueue() error { } // Run single command and return single result. -func (wp *Workflow) runCommand(cmd interface{}, payloads *commonpb.Payloads, header *commonpb.Header) (*internal.Message, error) { +func (wp *Workflow) runCommand(cmd any, payloads *commonpb.Payloads, header *commonpb.Header) (*internal.Message, error) { const op = errors.Op("workflow_process_runcommand") msg := wp.mq.AllocateMessage(cmd, payloads, header) diff --git a/aggregatedpool/queue/queue.go b/aggregatedpool/queue/queue.go index 2eb83b91..690338a9 100644 --- a/aggregatedpool/queue/queue.go +++ b/aggregatedpool/queue/queue.go @@ -25,7 +25,7 @@ func (mq *MessageQueue) Flush() { // AllocateMessage .. // TODO(rustatian) allocate??? -> to sync.Pool // Remove this method if flavor of sync.Pool with internal.Message -func (mq *MessageQueue) AllocateMessage(cmd interface{}, payloads *common.Payloads, header *common.Header) *internal.Message { +func (mq *MessageQueue) AllocateMessage(cmd any, payloads *common.Payloads, header *common.Header) *internal.Message { msg := &internal.Message{ ID: mq.SeqID(), Command: cmd, @@ -36,7 +36,7 @@ func (mq *MessageQueue) AllocateMessage(cmd interface{}, payloads *common.Payloa return msg } -func (mq *MessageQueue) PushCommand(cmd interface{}, payloads *common.Payloads, header *common.Header) { +func (mq *MessageQueue) PushCommand(cmd any, payloads *common.Payloads, header *common.Header) { mq.queue = append(mq.queue, &internal.Message{ ID: mq.SeqID(), Command: cmd, diff --git a/data_converter/converter.go b/data_converter/converter.go index 9b8a164a..a7493996 100644 --- a/data_converter/converter.go +++ b/data_converter/converter.go @@ -17,7 +17,7 @@ func NewDataConverter(fallback converter.DataConverter) converter.DataConverter } // ToPayloads converts a list of values. -func (r *DataConverter) ToPayloads(values ...interface{}) (*commonpb.Payloads, error) { +func (r *DataConverter) ToPayloads(values ...any) (*commonpb.Payloads, error) { for _, v := range values { if aggregated, ok := v.(*commonpb.Payloads); ok { // bypassing @@ -29,13 +29,13 @@ func (r *DataConverter) ToPayloads(values ...interface{}) (*commonpb.Payloads, e } // ToPayload converts single value to payload. -func (r *DataConverter) ToPayload(value interface{}) (*commonpb.Payload, error) { +func (r *DataConverter) ToPayload(value any) (*commonpb.Payload, error) { return r.dc.ToPayload(value) } // FromPayloads converts to a list of values of different types. // Useful for deserializing arguments of function invocations. -func (r *DataConverter) FromPayloads(payloads *commonpb.Payloads, valuePtrs ...interface{}) error { +func (r *DataConverter) FromPayloads(payloads *commonpb.Payloads, valuePtrs ...any) error { if payloads == nil { return nil } @@ -60,7 +60,7 @@ func (r *DataConverter) FromPayloads(payloads *commonpb.Payloads, valuePtrs ...i } // FromPayload converts single value from payload. -func (r *DataConverter) FromPayload(payload *commonpb.Payload, valuePtr interface{}) error { +func (r *DataConverter) FromPayload(payload *commonpb.Payload, valuePtr any) error { return r.dc.FromPayload(payload, valuePtr) } diff --git a/go.mod b/go.mod index d3afe62d..bfd126e2 100644 --- a/go.mod +++ b/go.mod @@ -6,8 +6,8 @@ require ( github.com/goccy/go-json v0.9.10 github.com/golang/protobuf v1.5.2 github.com/google/uuid v1.3.0 - github.com/roadrunner-server/api/v2 v2.20.0 - github.com/roadrunner-server/errors v1.1.2 + github.com/roadrunner-server/api/v2 v2.20.1 + github.com/roadrunner-server/errors v1.2.0 github.com/roadrunner-server/sdk/v2 v2.18.2 github.com/stretchr/testify v1.8.0 github.com/uber-go/tally/v4 v4.1.2 @@ -37,8 +37,8 @@ require ( github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect - github.com/roadrunner-server/goridge/v3 v3.4.5 // indirect - github.com/roadrunner-server/tcplisten v1.1.2 // indirect + github.com/roadrunner-server/goridge/v3 v3.5.0 // indirect + github.com/roadrunner-server/tcplisten v1.2.0 // indirect github.com/robfig/cron v1.2.0 // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect github.com/stretchr/objx v0.4.0 // indirect @@ -49,12 +49,12 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/goleak v1.1.12 // indirect go.uber.org/multierr v1.8.0 // indirect - golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b // indirect + golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48 // indirect golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect - golang.org/x/sys v0.0.0-20220731174439-a90be440212d // indirect + golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect - google.golang.org/genproto v0.0.0-20220802133213-ce4fa296bf78 // indirect + google.golang.org/genproto v0.0.0-20220804142021-4e6b2dfa6612 // indirect google.golang.org/grpc v1.48.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 64cc4d44..465e8d99 100644 --- a/go.sum +++ b/go.sum @@ -48,7 +48,6 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cactus/go-statsd-client/statsd v0.0.0-20200423205355-cb0885a1018c/go.mod h1:l/bIBLeOl9eX+wxJAzxS4TveKRtAqlyDpHjhkfO0MEI= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -234,16 +233,16 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/roadrunner-server/api/v2 v2.20.0 h1:VyWesy/EQGVcTk35KufUgUWSPwGprbC/N92Wb9t9NnM= -github.com/roadrunner-server/api/v2 v2.20.0/go.mod h1:9AvCOEhbNyfPuCCsrpL84TFb0k56BPmYQ6tUBNLS58c= -github.com/roadrunner-server/errors v1.1.2 h1:+LPw9Akgg+8LAGM4wASMWLAoBIbyP+mhNfR+FBS2Slw= -github.com/roadrunner-server/errors v1.1.2/go.mod h1:jVSh32nFtRMzKItYUM9W2CTLLpXAM8HseL2lUENPYtU= -github.com/roadrunner-server/goridge/v3 v3.4.5 h1:g7K9kOmyAOQQ9TusDYksgyKBsKQrQVNc0CT1HKhaphg= -github.com/roadrunner-server/goridge/v3 v3.4.5/go.mod h1:zGbUad2YyaaW9Vt9dqLBDcyrA45KlYoRh8jB7TUsStM= +github.com/roadrunner-server/api/v2 v2.20.1 h1:j6tIrIgxOLxa3ONCqYe4LfS0yIcch4QEzLcLmzcCkBQ= +github.com/roadrunner-server/api/v2 v2.20.1/go.mod h1:IlmguovM8ExuTctvmqitx8+cdfadzHi15fY5Njl55Kk= +github.com/roadrunner-server/errors v1.2.0 h1:qBmNXt8Iex9QnYTjCkbJKsBZu2EtYkQCM06GUDcQBbI= +github.com/roadrunner-server/errors v1.2.0/go.mod h1:z0ECxZp/dDa5RahtMcy4mBIavVxiZ9vwE5kByl7kFtY= +github.com/roadrunner-server/goridge/v3 v3.5.0 h1:z+ruMhKXD5BgGGKkvb3Ob1y9EihDUU4yIB+sLFQ7V9s= +github.com/roadrunner-server/goridge/v3 v3.5.0/go.mod h1:MJjF6RYNgPif7rDu1c9AsGNYVqnA7euKDVYRK5MNTw8= github.com/roadrunner-server/sdk/v2 v2.18.2 h1:t2Sz3ltV6sPSGfo7P0VdCk+p8pJYg2AnTOJArBHreAg= github.com/roadrunner-server/sdk/v2 v2.18.2/go.mod h1:3qWZftrmvbOZ8zjeRZIGBfoh1x1rJA8KW5ZtUrmyvdg= -github.com/roadrunner-server/tcplisten v1.1.2 h1:GBjKlSEbA67UB2y83rFWsQKqMQGyalhTN9Q9HCIMBC0= -github.com/roadrunner-server/tcplisten v1.1.2/go.mod h1:wN2/X46Vo60sC9L5Bf/eC8kL+X3//7KIFmANEXZaLsg= +github.com/roadrunner-server/tcplisten v1.2.0 h1:nsiXEEb0zP7vjAsCWNHKpM0HdwFK/KlafFF/2gsTJlg= +github.com/roadrunner-server/tcplisten v1.2.0/go.mod h1:NhumKvt7dbIKVNZnqR1fA4ET1D8ngIKsg0TxnuJTL6A= github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -295,8 +294,6 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe go.temporal.io/api v1.5.0/go.mod h1:BqKxEJJYdxb5dqf0ODfzfMxh8UEQ5L3zKS51FiIYYkA= go.temporal.io/api v1.8.0 h1:FzAMmBeLs6BEMFyHeJ9M9GAv6McFuH/GjnliBCdQ/Zw= go.temporal.io/api v1.8.0/go.mod h1:7m1ZOVUFi/54a5IMzMeELnvDy5sJwRfz11zi3Jrww8w= -go.temporal.io/api v1.11.0 h1:RepwYaOZcEII7oKPC0QAUJHiep04NbwGRwMZ6Ofg0es= -go.temporal.io/api v1.11.0/go.mod h1:Z1uAa6iqyq/lu0+41qOG+BNO2JsxXxrgUe8UJv2iNZI= go.temporal.io/sdk v1.12.0/go.mod h1:lSp3lH1lI0TyOsus0arnO3FYvjVXBZGi/G7DjnAnm6o= go.temporal.io/sdk v1.15.0 h1:1ZJEBNqLHAN0H64NpD4pydriYF9qhUIaimSVONm3ZKs= go.temporal.io/sdk v1.15.0/go.mod h1:peqnjALtNpJMKRplWEubefPhDXdAtRTnebsLSFypSts= @@ -393,11 +390,8 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220531201128-c960675eff93/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220728181054-f92ba40d432d/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20220728211354-c7608f3a8462 h1:UreQrH7DbFXSi9ZFox6FNT3WBooWmdANpU+IfkT1T4I= -golang.org/x/net v0.0.0-20220728211354-c7608f3a8462/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b h1:3ogNYyK4oIQdIKzTu68hQrr4iuVxF3AxKl9Aj/eDrw0= -golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48 h1:N9Vc/rorQUDes6B9CNdIxAn5jODGj2wzfrei2x4wNj4= +golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -466,11 +460,8 @@ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220730100132-1609e554cd39 h1:aNCnH+Fiqs7ZDTFH6oEFjIfbX2HvgQXJ6uQuUbTobjk= -golang.org/x/sys v0.0.0-20220730100132-1609e554cd39/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220731174439-a90be440212d h1:Sv5ogFZatcgIMMtBSTTAgMYsicp25MXBubjXNDKwm80= -golang.org/x/sys v0.0.0-20220731174439-a90be440212d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220804214406-8e32c043e418 h1:9vYwv7OjYaky/tlAeD7C4oC9EsPTlaFl1H2jS++V+ME= +golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -593,11 +584,8 @@ google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20220602131408-e326c6e8e9c8/go.mod h1:yKyY4AMRwFiC8yMMNaMi+RkCnjZJt9LoWuvhXjMs+To= -google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= -google.golang.org/genproto v0.0.0-20220728213248-dd149ef739b9 h1:d3fKQZK+1rWQMg3xLKQbPMirUCo29I/NRdI2WarSzTg= -google.golang.org/genproto v0.0.0-20220728213248-dd149ef739b9/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= -google.golang.org/genproto v0.0.0-20220802133213-ce4fa296bf78 h1:QntLWYqZeuBtJkth3m/6DLznnI0AHJr+AgJXvVh/izw= -google.golang.org/genproto v0.0.0-20220802133213-ce4fa296bf78/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220804142021-4e6b2dfa6612 h1:NX3L5YesD5qgxxrPHdKqHH38Ao0AG6poRXG+JljPsGU= +google.golang.org/genproto v0.0.0-20220804142021-4e6b2dfa6612/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= diff --git a/internal/codec/proto/proto.go b/internal/codec/proto/proto.go index 2a4f33f4..dd3e499f 100644 --- a/internal/codec/proto/proto.go +++ b/internal/codec/proto/proto.go @@ -26,7 +26,7 @@ func NewCodec(log *zap.Logger, dc converter.DataConverter) *Codec { log: log, dc: dc, frPool: sync.Pool{ - New: func() interface{} { + New: func() any { return &protocolV1.Frame{} }, }, diff --git a/internal/logger/wrapper.go b/internal/logger/wrapper.go index 43dc8d95..8e2ada47 100644 --- a/internal/logger/wrapper.go +++ b/internal/logger/wrapper.go @@ -17,23 +17,23 @@ func NewZapAdapter(zapLogger *zap.Logger) *ZapAdapter { } } -func (log *ZapAdapter) Debug(msg string, keyvals ...interface{}) { +func (log *ZapAdapter) Debug(msg string, keyvals ...any) { log.zl.Debug(msg, log.fields(keyvals)...) } -func (log *ZapAdapter) Info(msg string, keyvals ...interface{}) { +func (log *ZapAdapter) Info(msg string, keyvals ...any) { log.zl.Info(msg, log.fields(keyvals)...) } -func (log *ZapAdapter) Warn(msg string, keyvals ...interface{}) { +func (log *ZapAdapter) Warn(msg string, keyvals ...any) { log.zl.Warn(msg, log.fields(keyvals)...) } -func (log *ZapAdapter) Error(msg string, keyvals ...interface{}) { +func (log *ZapAdapter) Error(msg string, keyvals ...any) { log.zl.Error(msg, log.fields(keyvals)...) } -func (log *ZapAdapter) fields(keyvals []interface{}) []zap.Field { +func (log *ZapAdapter) fields(keyvals []any) []zap.Field { // we should have even number of keys and values if len(keyvals)%2 != 0 { return []zap.Field{zap.Error(fmt.Errorf("odd number of keyvals pairs: %v", keyvals))} diff --git a/internal/protocol.go b/internal/protocol.go index 57a77d84..dfa90789 100644 --- a/internal/protocol.go +++ b/internal/protocol.go @@ -60,7 +60,7 @@ type Message struct { ID uint64 `json:"id"` // Command of the message in unmarshalled form. Pointer. - Command interface{} `json:"command,omitempty"` + Command any `json:"command,omitempty"` // Failure associated with command id. Failure *failure.Failure `json:"failure,omitempty"` @@ -274,7 +274,7 @@ func (cmd ExecuteActivity) ActivityParams(env bindings.WorkflowEnvironment, payl } // LocalActivityParams maps activity command to activity params. -func (cmd ExecuteLocalActivity) LocalActivityParams(env bindings.WorkflowEnvironment, fn interface{}, payloads *commonpb.Payloads) bindings.ExecuteLocalActivityParams { +func (cmd ExecuteLocalActivity) LocalActivityParams(env bindings.WorkflowEnvironment, fn any, payloads *commonpb.Payloads) bindings.ExecuteLocalActivityParams { if cmd.Options.StartToCloseTimeout == 0 { cmd.Options.StartToCloseTimeout = time.Minute } @@ -303,7 +303,7 @@ func (cmd ExecuteLocalActivity) LocalActivityParams(env bindings.WorkflowEnviron ExecuteLocalActivityOptions: truTemOptions, ActivityFn: fn, ActivityType: cmd.Name, - InputArgs: []interface{}{payloads}, + InputArgs: []any{payloads}, WorkflowInfo: env.WorkflowInfo(), ScheduledTime: time.Now(), Header: nil, @@ -340,7 +340,7 @@ func (cmd NewTimer) ToDuration() time.Duration { } // CommandName returns command name (only for the commands sent to the worker) -func CommandName(cmd interface{}) (string, error) { +func CommandName(cmd any) (string, error) { const op = errors.Op("command_name") switch cmd.(type) { case GetWorkerInfo, *GetWorkerInfo: @@ -393,7 +393,7 @@ func CommandName(cmd interface{}) (string, error) { } // InitCommand reads command from binary payload -func InitCommand(name string) (interface{}, error) { +func InitCommand(name string) (any, error) { const op = errors.Op("init_command") switch name { case getWorkerInfoCommand: diff --git a/plugin.go b/plugin.go index 602c5620..b2865b52 100644 --- a/plugin.go +++ b/plugin.go @@ -353,7 +353,7 @@ func (p *Plugin) Name() string { return PluginName } -func (p *Plugin) RPC() interface{} { +func (p *Plugin) RPC() any { return &rpc{srv: p, client: p.client} }