You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lo...@apache.org on 2022/12/05 19:27:41 UTC
[beam] branch master updated: Update from interface{} -> any for core packages (#24505)
This is an automated email from the ASF dual-hosted git repository.
lostluck pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new d793631cd9c Update from interface{} -> any for core packages (#24505)
d793631cd9c is described below
commit d793631cd9c88b729d6d6311ae2109bc794aa12a
Author: Danny McCormick <da...@google.com>
AuthorDate: Mon Dec 5 14:27:31 2022 -0500
Update from interface{} -> any for core packages (#24505)
---
sdks/go/pkg/beam/core/funcx/fn_test.go | 2 +-
sdks/go/pkg/beam/core/funcx/output_test.go | 2 +-
sdks/go/pkg/beam/core/funcx/sideinput_test.go | 6 +-
sdks/go/pkg/beam/core/funcx/signature.go | 4 +-
sdks/go/pkg/beam/core/funcx/signature_test.go | 2 +-
sdks/go/pkg/beam/core/graph/bind.go | 2 +-
sdks/go/pkg/beam/core/graph/bind_test.go | 4 +-
sdks/go/pkg/beam/core/graph/coder/coder.go | 12 +-
sdks/go/pkg/beam/core/graph/coder/coder_test.go | 6 +-
sdks/go/pkg/beam/core/graph/coder/iterable.go | 8 +-
sdks/go/pkg/beam/core/graph/coder/iterable_test.go | 2 +-
sdks/go/pkg/beam/core/graph/coder/map_test.go | 2 +-
sdks/go/pkg/beam/core/graph/coder/nil_test.go | 2 +-
sdks/go/pkg/beam/core/graph/coder/registry.go | 2 +-
sdks/go/pkg/beam/core/graph/coder/registry_test.go | 4 +-
sdks/go/pkg/beam/core/graph/coder/row.go | 6 +-
sdks/go/pkg/beam/core/graph/coder/row_decoder.go | 16 +-
sdks/go/pkg/beam/core/graph/coder/row_encoder.go | 16 +-
sdks/go/pkg/beam/core/graph/coder/row_test.go | 36 +-
.../pkg/beam/core/graph/coder/testutil/testutil.go | 6 +-
.../core/graph/coder/testutil/testutil_test.go | 28 +-
sdks/go/pkg/beam/core/graph/fn.go | 8 +-
sdks/go/pkg/beam/core/graph/fn_test.go | 32 +-
sdks/go/pkg/beam/core/graph/xlang.go | 6 +-
sdks/go/pkg/beam/core/metrics/dumper.go | 10 +-
sdks/go/pkg/beam/core/metrics/dumper_test.go | 2 +-
sdks/go/pkg/beam/core/metrics/metrics.go | 4 +-
sdks/go/pkg/beam/core/metrics/store_test.go | 4 +-
sdks/go/pkg/beam/core/runtime/coderx/float_test.go | 2 +-
.../go/pkg/beam/core/runtime/coderx/string_test.go | 2 +-
.../go/pkg/beam/core/runtime/coderx/varint_test.go | 4 +-
sdks/go/pkg/beam/core/runtime/exec/coder.go | 10 +-
sdks/go/pkg/beam/core/runtime/exec/combine.go | 12 +-
sdks/go/pkg/beam/core/runtime/exec/combine_test.go | 26 +-
.../pkg/beam/core/runtime/exec/datasource_test.go | 42 +-
sdks/go/pkg/beam/core/runtime/exec/decode.go | 10 +-
.../go/pkg/beam/core/runtime/exec/dynsplit_test.go | 6 +-
sdks/go/pkg/beam/core/runtime/exec/emit.go | 6 +-
sdks/go/pkg/beam/core/runtime/exec/encode.go | 10 +-
sdks/go/pkg/beam/core/runtime/exec/fn.go | 26 +-
sdks/go/pkg/beam/core/runtime/exec/fn_test.go | 78 +--
sdks/go/pkg/beam/core/runtime/exec/fullvalue.go | 16 +-
.../pkg/beam/core/runtime/exec/fullvalue_test.go | 36 +-
sdks/go/pkg/beam/core/runtime/exec/hash.go | 12 +-
sdks/go/pkg/beam/core/runtime/exec/hash_test.go | 14 +-
sdks/go/pkg/beam/core/runtime/exec/input.go | 18 +-
.../beam/core/runtime/exec/optimized/callers.go | 176 +++---
.../beam/core/runtime/exec/optimized/callers.tmpl | 8 +-
.../beam/core/runtime/exec/optimized/decoders.go | 704 ++++++++++-----------
.../beam/core/runtime/exec/optimized/decoders.tmpl | 32 +-
.../beam/core/runtime/exec/optimized/emitters.go | 4 +-
.../beam/core/runtime/exec/optimized/emitters.tmpl | 4 +-
.../beam/core/runtime/exec/optimized/encoders.go | 672 ++++++++++----------
.../beam/core/runtime/exec/optimized/encoders.tmpl | 32 +-
.../pkg/beam/core/runtime/exec/optimized/inputs.go | 4 +-
.../beam/core/runtime/exec/optimized/inputs.tmpl | 4 +-
sdks/go/pkg/beam/core/runtime/exec/pardo.go | 4 +-
sdks/go/pkg/beam/core/runtime/exec/pardo_test.go | 18 +-
.../pkg/beam/core/runtime/exec/pcollection_test.go | 2 +-
sdks/go/pkg/beam/core/runtime/exec/sdf.go | 16 +-
sdks/go/pkg/beam/core/runtime/exec/sdf_invokers.go | 138 ++--
.../beam/core/runtime/exec/sdf_invokers_test.go | 18 +-
sdks/go/pkg/beam/core/runtime/exec/sdf_test.go | 4 +-
sdks/go/pkg/beam/core/runtime/exec/sideinput.go | 6 +-
sdks/go/pkg/beam/core/runtime/exec/unit_test.go | 2 +-
sdks/go/pkg/beam/core/runtime/exec/userstate.go | 42 +-
.../pkg/beam/core/runtime/exec/userstate_test.go | 6 +-
sdks/go/pkg/beam/core/runtime/genx/genx.go | 6 +-
sdks/go/pkg/beam/core/runtime/genx/genx_test.go | 2 +-
sdks/go/pkg/beam/core/runtime/graphx/serialize.go | 2 +-
.../pkg/beam/core/runtime/graphx/translate_test.go | 8 +-
sdks/go/pkg/beam/core/runtime/graphx/user_test.go | 2 +-
sdks/go/pkg/beam/core/runtime/graphx/xlang.go | 4 +-
sdks/go/pkg/beam/core/runtime/harness/harness.go | 4 +-
sdks/go/pkg/beam/core/runtime/harness/session.go | 2 +-
.../runtime/harness/statecache/statecache_test.go | 4 +-
sdks/go/pkg/beam/core/runtime/symbols.go | 6 +-
sdks/go/pkg/beam/core/runtime/xlangx/payload.go | 4 +-
.../pkg/beam/core/runtime/xlangx/registry_test.go | 2 +-
sdks/go/pkg/beam/core/sdf/lock.go | 6 +-
sdks/go/pkg/beam/core/sdf/sdf.go | 6 +-
sdks/go/pkg/beam/core/state/state.go | 34 +-
sdks/go/pkg/beam/core/state/state_test.go | 108 ++--
sdks/go/pkg/beam/core/typex/class_test.go | 6 +-
sdks/go/pkg/beam/core/typex/special.go | 14 +-
sdks/go/pkg/beam/core/util/jsonx/jsonx.go | 8 +-
sdks/go/pkg/beam/core/util/reflectx/call.go | 18 +-
sdks/go/pkg/beam/core/util/reflectx/call_test.go | 16 +-
sdks/go/pkg/beam/core/util/reflectx/calls.go | 446 ++++++-------
sdks/go/pkg/beam/core/util/reflectx/calls.tmpl | 10 +-
sdks/go/pkg/beam/core/util/reflectx/functions.go | 4 +-
sdks/go/pkg/beam/core/util/reflectx/structs.go | 8 +-
.../go/pkg/beam/core/util/reflectx/structs_test.go | 4 +-
sdks/go/pkg/beam/core/util/reflectx/types_test.go | 12 +-
sdks/go/pkg/beam/core/util/reflectx/util.go | 4 +-
sdks/go/pkg/beam/core/util/reflectx/util_test.go | 4 +-
sdks/go/pkg/beam/core/util/symtab/symtab_test.go | 2 +-
97 files changed, 1608 insertions(+), 1608 deletions(-)
diff --git a/sdks/go/pkg/beam/core/funcx/fn_test.go b/sdks/go/pkg/beam/core/funcx/fn_test.go
index 9eee359c1e5..6890adc8ec3 100644
--- a/sdks/go/pkg/beam/core/funcx/fn_test.go
+++ b/sdks/go/pkg/beam/core/funcx/fn_test.go
@@ -51,7 +51,7 @@ func (m foo) Do(context.Context, int, string) (string, int, error) {
func TestNew(t *testing.T) {
tests := []struct {
Name string
- Fn interface{}
+ Fn any
Param []FnParamKind
Ret []ReturnKind
Err error
diff --git a/sdks/go/pkg/beam/core/funcx/output_test.go b/sdks/go/pkg/beam/core/funcx/output_test.go
index 65ac8fd7b86..c04efd44652 100644
--- a/sdks/go/pkg/beam/core/funcx/output_test.go
+++ b/sdks/go/pkg/beam/core/funcx/output_test.go
@@ -24,7 +24,7 @@ import (
func TestIsEmit(t *testing.T) {
tests := []struct {
- Fn interface{}
+ Fn any
Exp bool
}{
{func() {}, false}, // no values
diff --git a/sdks/go/pkg/beam/core/funcx/sideinput_test.go b/sdks/go/pkg/beam/core/funcx/sideinput_test.go
index f9048ee1843..bb48331b1c4 100644
--- a/sdks/go/pkg/beam/core/funcx/sideinput_test.go
+++ b/sdks/go/pkg/beam/core/funcx/sideinput_test.go
@@ -24,7 +24,7 @@ import (
func TestIsIter(t *testing.T) {
tests := []struct {
- Fn interface{}
+ Fn any
Exp bool
}{
{func(*int) {}, false}, // no return
@@ -51,7 +51,7 @@ func TestIsIter(t *testing.T) {
func TestIsReIter(t *testing.T) {
tests := []struct {
- Fn interface{}
+ Fn any
Exp bool
}{
{func() bool { return false }, false}, // not returning an Iter
@@ -71,7 +71,7 @@ func TestIsReIter(t *testing.T) {
func TestIsMultiMap(t *testing.T) {
tests := []struct {
- Fn interface{}
+ Fn any
Exp bool
}{
{func(int) func(*int) bool { return nil }, true},
diff --git a/sdks/go/pkg/beam/core/funcx/signature.go b/sdks/go/pkg/beam/core/funcx/signature.go
index 03ee67e0406..091f7a4c0e1 100644
--- a/sdks/go/pkg/beam/core/funcx/signature.go
+++ b/sdks/go/pkg/beam/core/funcx/signature.go
@@ -108,7 +108,7 @@ func replace(list []reflect.Type, old, new reflect.Type) []reflect.Type {
// both would satisfy a signature of (context.Context?, int) -> bool. Only
// "foo" would satisfy (context.Context, string) -> bool and only "bar" would
// satisfy (int) -> bool.
-func Satisfy(fn interface{}, sig *Signature) error {
+func Satisfy(fn any, sig *Signature) error {
var in, out []reflect.Type
var typ reflect.Type
switch fx := fn.(type) {
@@ -227,7 +227,7 @@ func matchOpt(list, models []reflect.Type, m map[string]reflect.Type) error {
}
// MustSatisfy panics if the given fn does not satisfy the signature.
-func MustSatisfy(fn interface{}, sig *Signature) {
+func MustSatisfy(fn any, sig *Signature) {
if err := Satisfy(fn, sig); err != nil {
panic(errors.Wrapf(err, "fn does not satisfy signature %v", sig))
}
diff --git a/sdks/go/pkg/beam/core/funcx/signature_test.go b/sdks/go/pkg/beam/core/funcx/signature_test.go
index 5ffc6a5d250..fa0dc05c4cb 100644
--- a/sdks/go/pkg/beam/core/funcx/signature_test.go
+++ b/sdks/go/pkg/beam/core/funcx/signature_test.go
@@ -26,7 +26,7 @@ import (
func TestSatisfy(t *testing.T) {
tests := []struct {
Sig *Signature
- Fn interface{}
+ Fn any
Ok bool
}{
// Concrete signature
diff --git a/sdks/go/pkg/beam/core/graph/bind.go b/sdks/go/pkg/beam/core/graph/bind.go
index 28dbc3f4f17..7ad0107571d 100644
--- a/sdks/go/pkg/beam/core/graph/bind.go
+++ b/sdks/go/pkg/beam/core/graph/bind.go
@@ -134,7 +134,7 @@ func returnTypes(list []funcx.ReturnParam) []reflect.Type {
func findInbound(fn *funcx.Fn, in ...typex.FullType) ([]typex.FullType, []InputKind, error) {
// log.Printf("Bind inbound: %v %v", fn, in)
- addContext := func(err error, p []funcx.FnParam, in interface{}) error {
+ addContext := func(err error, p []funcx.FnParam, in any) error {
return errors.WithContextf(err, "binding params %v to input %v", p, in)
}
diff --git a/sdks/go/pkg/beam/core/graph/bind_test.go b/sdks/go/pkg/beam/core/graph/bind_test.go
index 5bd4156dbbd..e551b0eb4c6 100644
--- a/sdks/go/pkg/beam/core/graph/bind_test.go
+++ b/sdks/go/pkg/beam/core/graph/bind_test.go
@@ -28,7 +28,7 @@ import (
func TestBind(t *testing.T) {
tests := []struct {
In []typex.FullType // Incoming Node type
- Fn interface{}
+ Fn any
Out []typex.FullType // Outgoing Node type; nil == cannot bind
}{
{ // Direct
@@ -173,7 +173,7 @@ func TestBindWithTypedefs(t *testing.T) {
tests := []struct {
In []typex.FullType // Incoming Node type
Typedef map[string]reflect.Type
- Fn interface{}
+ Fn any
Out []typex.FullType // Outgoing Node type; nil == cannot bind
}{
{ // Typedefs are ignored, if not used
diff --git a/sdks/go/pkg/beam/core/graph/coder/coder.go b/sdks/go/pkg/beam/core/graph/coder/coder.go
index bd6dd8c89ff..28e235860bd 100644
--- a/sdks/go/pkg/beam/core/graph/coder/coder.go
+++ b/sdks/go/pkg/beam/core/graph/coder/coder.go
@@ -101,15 +101,15 @@ var (
// ElementEncoder encapsulates being able to encode an element into a writer.
type ElementEncoder interface {
- Encode(element interface{}, w io.Writer) error
+ Encode(element any, w io.Writer) error
}
// ElementDecoder encapsulates being able to decode an element from a reader.
type ElementDecoder interface {
- Decode(r io.Reader) (interface{}, error)
+ Decode(r io.Reader) (any, error)
}
-func validateEncoder(t reflect.Type, encode interface{}) error {
+func validateEncoder(t reflect.Type, encode any) error {
// Check if it uses the real type in question.
if err := funcx.Satisfy(encode, funcx.Replace(encodeSig, typex.TType, t)); err != nil {
return errors.WithContext(err, "validateEncoder: validating signature")
@@ -118,19 +118,19 @@ func validateEncoder(t reflect.Type, encode interface{}) error {
return nil
}
-func validateDecoder(t reflect.Type, decode interface{}) error {
+func validateDecoder(t reflect.Type, decode any) error {
// Check if it uses the real type in question.
if err := funcx.Satisfy(decode, funcx.Replace(decodeSig, typex.TType, t)); err != nil {
return errors.WithContext(err, "validateDecoder: validating signature")
}
- // TODO(lostluck): 2019.02.03 - Expand cases to avoid []byte -> interface{} conversion
+ // TODO(lostluck): 2019.02.03 - Expand cases to avoid []byte -> any conversion
// in exec, & a beam Decoder interface.
return nil
}
// NewCustomCoder creates a coder for the supplied parameters defining a
// particular encoding strategy.
-func NewCustomCoder(id string, t reflect.Type, encode, decode interface{}) (*CustomCoder, error) {
+func NewCustomCoder(id string, t reflect.Type, encode, decode any) (*CustomCoder, error) {
if err := validateEncoder(t, encode); err != nil {
return nil, errors.WithContext(err, "NewCustomCoder")
}
diff --git a/sdks/go/pkg/beam/core/graph/coder/coder_test.go b/sdks/go/pkg/beam/core/graph/coder/coder_test.go
index 44606dc1efb..040a0402c85 100644
--- a/sdks/go/pkg/beam/core/graph/coder/coder_test.go
+++ b/sdks/go/pkg/beam/core/graph/coder/coder_test.go
@@ -45,7 +45,7 @@ var (
func TestValidEncoderForms(t *testing.T) {
tests := []struct {
t reflect.Type
- enc interface{}
+ enc any
}{
{t: mT, enc: func(MyType) []byte { return nil }},
{t: mT, enc: func(MyType) ([]byte, error) { return nil, nil }},
@@ -84,7 +84,7 @@ func TestValidEncoderForms(t *testing.T) {
func TestValidDecoderForms(t *testing.T) {
tests := []struct {
t reflect.Type
- dec interface{}
+ dec any
}{
{t: mT, dec: func([]byte) MyType { return MyType{} }},
{t: mT, dec: func([]byte) (MyType, error) { return MyType{}, nil }},
@@ -314,7 +314,7 @@ func TestCustomCoder_Equals(t *testing.T) {
cusStrEnc2 := func(string) []byte { return nil }
cusStrDec2 := func([]byte) string { return "" }
- newCC := func(t *testing.T, name string, et reflect.Type, enc, dec interface{}) *CustomCoder {
+ newCC := func(t *testing.T, name string, et reflect.Type, enc, dec any) *CustomCoder {
t.Helper()
cc, err := NewCustomCoder(name, et, enc, dec)
if err != nil {
diff --git a/sdks/go/pkg/beam/core/graph/coder/iterable.go b/sdks/go/pkg/beam/core/graph/coder/iterable.go
index 36fb1c6f280..cc41ba53360 100644
--- a/sdks/go/pkg/beam/core/graph/coder/iterable.go
+++ b/sdks/go/pkg/beam/core/graph/coder/iterable.go
@@ -29,14 +29,14 @@ import (
//
// Returns an error if the given type is invalid or not encodable to a beam
// schema row.
-func EncoderForSlice(rt reflect.Type) (func(interface{}, io.Writer) error, error) {
+func EncoderForSlice(rt reflect.Type) (func(any, io.Writer) error, error) {
var bld RowEncoderBuilder
eEnc, err := bld.encoderForSingleTypeReflect(rt.Elem())
if err != nil {
return nil, err
}
enc := iterableEncoder(rt, eEnc)
- return func(v interface{}, w io.Writer) error {
+ return func(v any, w io.Writer) error {
return enc(reflect.ValueOf(v), w)
}, nil
}
@@ -46,14 +46,14 @@ func EncoderForSlice(rt reflect.Type) (func(interface{}, io.Writer) error, error
//
// Returns an error if the given type is invalid or not decodable from a beam
// schema row.
-func DecoderForSlice(rt reflect.Type) (func(io.Reader) (interface{}, error), error) {
+func DecoderForSlice(rt reflect.Type) (func(io.Reader) (any, error), error) {
var bld RowDecoderBuilder
eDec, err := bld.decoderForSingleTypeReflect(rt.Elem())
if err != nil {
return nil, err
}
dec := iterableDecoderForSlice(rt, eDec)
- return func(r io.Reader) (interface{}, error) {
+ return func(r io.Reader) (any, error) {
rv := reflect.New(rt)
err := dec(rv.Elem(), r)
return rv.Elem().Interface(), err
diff --git a/sdks/go/pkg/beam/core/graph/coder/iterable_test.go b/sdks/go/pkg/beam/core/graph/coder/iterable_test.go
index b4d6ba33dd5..0d218c612ef 100644
--- a/sdks/go/pkg/beam/core/graph/coder/iterable_test.go
+++ b/sdks/go/pkg/beam/core/graph/coder/iterable_test.go
@@ -40,7 +40,7 @@ func TestEncodeDecodeIterable(t *testing.T) {
}
tests := []struct {
- v interface{}
+ v any
encElm func(reflect.Value, io.Writer) error
decElm func(reflect.Value, io.Reader) error
encoded []byte
diff --git a/sdks/go/pkg/beam/core/graph/coder/map_test.go b/sdks/go/pkg/beam/core/graph/coder/map_test.go
index d1a129a2338..9f84e1cb92a 100644
--- a/sdks/go/pkg/beam/core/graph/coder/map_test.go
+++ b/sdks/go/pkg/beam/core/graph/coder/map_test.go
@@ -44,7 +44,7 @@ func TestEncodeDecodeMap(t *testing.T) {
ptrByte := byte(42)
tests := []struct {
- v interface{}
+ v any
encK, encV func(reflect.Value, io.Writer) error
decK, decV func(reflect.Value, io.Reader) error
encoded []byte
diff --git a/sdks/go/pkg/beam/core/graph/coder/nil_test.go b/sdks/go/pkg/beam/core/graph/coder/nil_test.go
index 89410b9c939..0435bba271e 100644
--- a/sdks/go/pkg/beam/core/graph/coder/nil_test.go
+++ b/sdks/go/pkg/beam/core/graph/coder/nil_test.go
@@ -50,7 +50,7 @@ func TestEncodeDecodeNullable(t *testing.T) {
byteCtnrPtrDec := NullableDecoder(bytePtrDec)
tests := []struct {
- decoded interface{}
+ decoded any
encoded []byte
}{
{
diff --git a/sdks/go/pkg/beam/core/graph/coder/registry.go b/sdks/go/pkg/beam/core/graph/coder/registry.go
index 5eb2abc5f61..3b7dd18fcf7 100644
--- a/sdks/go/pkg/beam/core/graph/coder/registry.go
+++ b/sdks/go/pkg/beam/core/graph/coder/registry.go
@@ -42,7 +42,7 @@ var (
// over to check if element types implement them.
//
// Repeated registrations of the same type overrides prior ones.
-func RegisterCoder(t reflect.Type, enc, dec interface{}) {
+func RegisterCoder(t reflect.Type, enc, dec any) {
key := tkey(t)
if _, err := NewCustomCoder(t.String(), t, enc, dec); err != nil {
diff --git a/sdks/go/pkg/beam/core/graph/coder/registry_test.go b/sdks/go/pkg/beam/core/graph/coder/registry_test.go
index fa26f64a819..aec640d3abb 100644
--- a/sdks/go/pkg/beam/core/graph/coder/registry_test.go
+++ b/sdks/go/pkg/beam/core/graph/coder/registry_test.go
@@ -79,7 +79,7 @@ func TestRegisterCoder(t *testing.T) {
tests := []struct {
name string
typ reflect.Type
- enc, dec interface{}
+ enc, dec any
}{{
name: "nonSatisfyingInterface",
typ: msType, enc: aEnc, dec: aDec,
@@ -135,7 +135,7 @@ func TestRegisterCoder(t *testing.T) {
}
func TestLookupCustomCoder(t *testing.T) {
- newCC := func(t *testing.T, name string, et reflect.Type, enc, dec interface{}) *CustomCoder {
+ newCC := func(t *testing.T, name string, et reflect.Type, enc, dec any) *CustomCoder {
t.Helper()
cc, err := NewCustomCoder(name, et, enc, dec)
if err != nil {
diff --git a/sdks/go/pkg/beam/core/graph/coder/row.go b/sdks/go/pkg/beam/core/graph/coder/row.go
index 52e883f3d27..f958d84154c 100644
--- a/sdks/go/pkg/beam/core/graph/coder/row.go
+++ b/sdks/go/pkg/beam/core/graph/coder/row.go
@@ -40,7 +40,7 @@ func RequireAllFieldsExported(require bool) {
}
// RegisterSchemaProviders Register Custom Schema providers.
-func RegisterSchemaProviders(rt reflect.Type, enc, dec interface{}) {
+func RegisterSchemaProviders(rt reflect.Type, enc, dec any) {
defaultEnc.Register(rt, enc)
defaultDec.Register(rt, dec)
}
@@ -50,7 +50,7 @@ func RegisterSchemaProviders(rt reflect.Type, enc, dec interface{}) {
//
// Returns an error if the given type is invalid or not encodable to a beam
// schema row.
-func RowEncoderForStruct(rt reflect.Type) (func(interface{}, io.Writer) error, error) {
+func RowEncoderForStruct(rt reflect.Type) (func(any, io.Writer) error, error) {
return defaultEnc.Build(rt)
}
@@ -59,7 +59,7 @@ func RowEncoderForStruct(rt reflect.Type) (func(interface{}, io.Writer) error, e
//
// Returns an error if the given type is invalid or not decodable from a beam
// schema row.
-func RowDecoderForStruct(rt reflect.Type) (func(io.Reader) (interface{}, error), error) {
+func RowDecoderForStruct(rt reflect.Type) (func(io.Reader) (any, error), error) {
return defaultDec.Build(rt)
}
diff --git a/sdks/go/pkg/beam/core/graph/coder/row_decoder.go b/sdks/go/pkg/beam/core/graph/coder/row_decoder.go
index 689f687af14..8dabc2be9ff 100644
--- a/sdks/go/pkg/beam/core/graph/coder/row_decoder.go
+++ b/sdks/go/pkg/beam/core/graph/coder/row_decoder.go
@@ -35,7 +35,7 @@ type RowDecoderBuilder struct {
RequireAllFieldsExported bool
}
-type decoderProvider = func(reflect.Type) (func(io.Reader) (interface{}, error), error)
+type decoderProvider = func(reflect.Type) (func(io.Reader) (any, error), error)
// Register accepts a provider to decode schema encoded values
// of that type.
@@ -46,8 +46,8 @@ type decoderProvider = func(reflect.Type) (func(io.Reader) (interface{}, error),
// default Beam Schema encoding behavior.
//
// TODO(BEAM-9615): Add final factory types. This interface is subject to change.
-// Currently f must be a function func(reflect.Type) (func(io.Reader) (interface{}, error), error)
-func (b *RowDecoderBuilder) Register(rt reflect.Type, f interface{}) {
+// Currently f must be a function func(reflect.Type) (func(io.Reader) (any, error), error)
+func (b *RowDecoderBuilder) Register(rt reflect.Type, f any) {
fd, ok := f.(decoderProvider)
if !ok {
panic(fmt.Sprintf("%T isn't a supported decoder function type (passed with %v), currently expecting %T", f, rt, (decoderProvider)(nil)))
@@ -68,7 +68,7 @@ func (b *RowDecoderBuilder) Register(rt reflect.Type, f interface{}) {
// Build constructs a Beam Schema coder for the given type, using any providers registered for
// itself or it's fields.
-func (b *RowDecoderBuilder) Build(rt reflect.Type) (func(io.Reader) (interface{}, error), error) {
+func (b *RowDecoderBuilder) Build(rt reflect.Type) (func(io.Reader) (any, error), error) {
if err := rowTypeValidation(rt, true); err != nil {
return nil, err
}
@@ -76,7 +76,7 @@ func (b *RowDecoderBuilder) Build(rt reflect.Type) (func(io.Reader) (interface{}
}
// decoderForType returns a decoder function for the struct or pointer to struct type.
-func (b *RowDecoderBuilder) decoderForType(t reflect.Type) (func(io.Reader) (interface{}, error), error) {
+func (b *RowDecoderBuilder) decoderForType(t reflect.Type) (func(io.Reader) (any, error), error) {
// Check if there are any providers registered for this type, or that this type adheres to any interfaces.
f, addr, err := b.customFunc(t)
if err != nil {
@@ -102,7 +102,7 @@ func (b *RowDecoderBuilder) decoderForType(t reflect.Type) (func(io.Reader) (int
}
if isPtr {
- return func(r io.Reader) (interface{}, error) {
+ return func(r io.Reader) (any, error) {
rv := reflect.New(t)
err := dec(rv.Elem(), r)
// Wrap handles nil cases, but io.EOF should be checked explicitly.
@@ -112,7 +112,7 @@ func (b *RowDecoderBuilder) decoderForType(t reflect.Type) (func(io.Reader) (int
return rv.Interface(), errors.Wrapf(err, "decoding a *%v", t)
}, nil
}
- return func(r io.Reader) (interface{}, error) {
+ return func(r io.Reader) (any, error) {
rv := reflect.New(t)
err := dec(rv.Elem(), r)
// Wrap handles nil cases, but io.EOF should be checked explicitly.
@@ -270,7 +270,7 @@ func reflectDecodeByteSlice(rv reflect.Value, r io.Reader) error {
// customFunc returns nil if no custom func exists for this type.
// If an error is returned, coder construction should be aborted.
-func (b *RowDecoderBuilder) customFunc(t reflect.Type) (func(io.Reader) (interface{}, error), bool, error) {
+func (b *RowDecoderBuilder) customFunc(t reflect.Type) (func(io.Reader) (any, error), bool, error) {
if fact, ok := b.allFuncs[t]; ok {
f, err := fact(t)
diff --git a/sdks/go/pkg/beam/core/graph/coder/row_encoder.go b/sdks/go/pkg/beam/core/graph/coder/row_encoder.go
index dc41890b004..2756c9b8e70 100644
--- a/sdks/go/pkg/beam/core/graph/coder/row_encoder.go
+++ b/sdks/go/pkg/beam/core/graph/coder/row_encoder.go
@@ -35,7 +35,7 @@ type RowEncoderBuilder struct {
RequireAllFieldsExported bool
}
-type encoderProvider = func(reflect.Type) (func(interface{}, io.Writer) error, error)
+type encoderProvider = func(reflect.Type) (func(any, io.Writer) error, error)
// Register accepts a provider for the given type to schema encode values of that type.
//
@@ -45,7 +45,7 @@ type encoderProvider = func(reflect.Type) (func(interface{}, io.Writer) error, e
//
// TODO(BEAM-9615): Add final factory types. This interface is subject to change.
// Currently f must be a function of the type func(reflect.Type) func(T, io.Writer) (error).
-func (b *RowEncoderBuilder) Register(rt reflect.Type, f interface{}) {
+func (b *RowEncoderBuilder) Register(rt reflect.Type, f any) {
fe, ok := f.(encoderProvider)
if !ok {
panic(fmt.Sprintf("%T isn't a supported encoder function type (passed with %v)", f, rt))
@@ -65,7 +65,7 @@ func (b *RowEncoderBuilder) Register(rt reflect.Type, f interface{}) {
// Build constructs a Beam Schema coder for the given type, using any providers registered for
// itself or it's fields.
-func (b *RowEncoderBuilder) Build(rt reflect.Type) (func(interface{}, io.Writer) error, error) {
+func (b *RowEncoderBuilder) Build(rt reflect.Type) (func(any, io.Writer) error, error) {
if err := rowTypeValidation(rt, true); err != nil {
return nil, err
}
@@ -74,7 +74,7 @@ func (b *RowEncoderBuilder) Build(rt reflect.Type) (func(interface{}, io.Writer)
// customFunc returns nil if no custom func exists for this type.
// If an error is returned, coder construction should be aborted.
-func (b *RowEncoderBuilder) customFunc(t reflect.Type) (func(interface{}, io.Writer) error, bool, error) {
+func (b *RowEncoderBuilder) customFunc(t reflect.Type) (func(any, io.Writer) error, bool, error) {
if fact, ok := b.allFuncs[t]; ok {
f, err := fact(t)
@@ -111,7 +111,7 @@ func (b *RowEncoderBuilder) customFunc(t reflect.Type) (func(interface{}, io.Wri
}
// encoderForType returns an encoder function for the struct or pointer to struct type.
-func (b *RowEncoderBuilder) encoderForType(t reflect.Type) (func(interface{}, io.Writer) error, error) {
+func (b *RowEncoderBuilder) encoderForType(t reflect.Type) (func(any, io.Writer) error, error) {
// Check if there are any providers registered for this type, or that this type adheres to any interfaces.
var isPtr bool
// Pointers become the value type for decomposition.
@@ -145,7 +145,7 @@ func (b *RowEncoderBuilder) encoderForType(t reflect.Type) (func(interface{}, io
if isPtr {
// We have the value version, but not a pointer version, so we jump through reflect to
// get the right type to pass in.
- return func(v interface{}, w io.Writer) error {
+ return func(v any, w io.Writer) error {
return enc(reflect.ValueOf(v).Elem().Interface(), w)
}, nil
}
@@ -159,11 +159,11 @@ func (b *RowEncoderBuilder) encoderForType(t reflect.Type) (func(interface{}, io
}
if isPtr {
- return func(v interface{}, w io.Writer) error {
+ return func(v any, w io.Writer) error {
return enc(reflect.ValueOf(v).Elem(), w)
}, nil
}
- return func(v interface{}, w io.Writer) error {
+ return func(v any, w io.Writer) error {
return enc(reflect.ValueOf(v), w)
}, nil
}
diff --git a/sdks/go/pkg/beam/core/graph/coder/row_test.go b/sdks/go/pkg/beam/core/graph/coder/row_test.go
index face83a2279..1549123558b 100644
--- a/sdks/go/pkg/beam/core/graph/coder/row_test.go
+++ b/sdks/go/pkg/beam/core/graph/coder/row_test.go
@@ -29,7 +29,7 @@ import (
func TestReflectionRowCoderGeneration(t *testing.T) {
num := 35
tests := []struct {
- want interface{}
+ want any
}{
{
// Top level value check
@@ -282,7 +282,7 @@ type userType6 struct {
// Note: pointers to unexported types can't be handled by
// this package. See https://golang.org/issue/21357.
-func ut1Enc(val interface{}, w io.Writer) error {
+func ut1Enc(val any, w io.Writer) error {
if err := WriteSimpleRowHeader(3, w); err != nil {
return err
}
@@ -299,7 +299,7 @@ func ut1Enc(val interface{}, w io.Writer) error {
return nil
}
-func ut1Dec(r io.Reader) (interface{}, error) {
+func ut1Dec(r io.Reader) (any, error) {
if err := ReadSimpleRowHeader(3, r); err != nil {
return nil, err
}
@@ -329,7 +329,7 @@ func TestRowCoder_CustomCoder(t *testing.T) {
num := 35
tests := []struct {
- want interface{}
+ want any
}{
{
// Top level value check
@@ -387,13 +387,13 @@ func TestRowCoder_CustomCoder(t *testing.T) {
t.Run(fmt.Sprintf("%+v", test.want), func(t *testing.T) {
rt := reflect.TypeOf(test.want)
var encB RowEncoderBuilder
- encB.Register(customRT, func(reflect.Type) (func(interface{}, io.Writer) error, error) { return customEnc, nil })
+ encB.Register(customRT, func(reflect.Type) (func(any, io.Writer) error, error) { return customEnc, nil })
enc, err := encB.Build(rt)
if err != nil {
t.Fatalf("RowEncoderBuilder.Build(%v) = %v, want nil error", rt, err)
}
var decB RowDecoderBuilder
- decB.Register(customRT, func(reflect.Type) (func(io.Reader) (interface{}, error), error) { return customDec, nil })
+ decB.Register(customRT, func(reflect.Type) (func(io.Reader) (any, error), error) { return customDec, nil })
dec, err := decB.Build(rt)
if err != nil {
t.Fatalf("RowDecoderBuilder.Build(%v) = %v, want nil error", rt, err)
@@ -411,7 +411,7 @@ func TestRowCoder_CustomCoder(t *testing.T) {
}
func BenchmarkRowCoder_RoundTrip(b *testing.B) {
- ut1Enc := func(val interface{}, w io.Writer) error {
+ ut1Enc := func(val any, w io.Writer) error {
elm := val.(UserType1)
// We have 3 fields we use.
if err := EncodeVarInt(3, w); err != nil {
@@ -432,7 +432,7 @@ func BenchmarkRowCoder_RoundTrip(b *testing.B) {
}
return nil
}
- ut1Dec := func(r io.Reader) (interface{}, error) {
+ ut1Dec := func(r io.Reader) (any, error) {
// We have 3 fields we use.
n, err := DecodeVarInt(r)
if err != nil {
@@ -470,10 +470,10 @@ func BenchmarkRowCoder_RoundTrip(b *testing.B) {
num := 35
benches := []struct {
- want interface{}
+ want any
customRT reflect.Type
- customEnc func(interface{}, io.Writer) error
- customDec func(io.Reader) (interface{}, error)
+ customEnc func(any, io.Writer) error
+ customDec func(io.Reader) (any, error)
}{
{
// Top level value check
@@ -603,13 +603,13 @@ func BenchmarkRowCoder_RoundTrip(b *testing.B) {
}
if bench.customEnc != nil && bench.customDec != nil {
var encB RowEncoderBuilder
- encB.Register(bench.customRT, func(reflect.Type) (func(interface{}, io.Writer) error, error) { return bench.customEnc, nil })
+ encB.Register(bench.customRT, func(reflect.Type) (func(any, io.Writer) error, error) { return bench.customEnc, nil })
enc, err := encB.Build(rt)
if err != nil {
b.Fatalf("RowEncoderBuilder.Build(%v) = %v, want nil error", rt, err)
}
var decB RowDecoderBuilder
- decB.Register(bench.customRT, func(reflect.Type) (func(io.Reader) (interface{}, error), error) { return bench.customDec, nil })
+ decB.Register(bench.customRT, func(reflect.Type) (func(io.Reader) (any, error), error) { return bench.customDec, nil })
dec, err := decB.Build(rt)
if err != nil {
b.Fatalf("RowDecoderBuilder.Build(%v) = %v, want nil error", rt, err)
@@ -664,12 +664,12 @@ func (p *testProvider) FromLogicalType(rt reflect.Type) (reflect.Type, error) {
return testStorageType, nil
}
-func (p *testProvider) BuildEncoder(rt reflect.Type) (func(interface{}, io.Writer) error, error) {
+func (p *testProvider) BuildEncoder(rt reflect.Type) (func(any, io.Writer) error, error) {
if _, err := p.FromLogicalType(rt); err != nil {
return nil, err
}
- return func(iface interface{}, w io.Writer) error {
+ return func(iface any, w io.Writer) error {
v := iface.(testInterface)
data, err := v.TestEncode()
if err != nil {
@@ -685,13 +685,13 @@ func (p *testProvider) BuildEncoder(rt reflect.Type) (func(interface{}, io.Write
}, nil
}
-func (p *testProvider) BuildDecoder(rt reflect.Type) (func(io.Reader) (interface{}, error), error) {
+func (p *testProvider) BuildDecoder(rt reflect.Type) (func(io.Reader) (any, error), error) {
if _, err := p.FromLogicalType(rt); err != nil {
return nil, err
}
if rt.Kind() == reflect.Ptr {
rt = rt.Elem()
- return func(r io.Reader) (interface{}, error) {
+ return func(r io.Reader) (any, error) {
if err := ReadSimpleRowHeader(1, r); err != nil {
return nil, err
}
@@ -709,7 +709,7 @@ func (p *testProvider) BuildDecoder(rt reflect.Type) (func(io.Reader) (interface
return v, nil
}, nil
}
- return func(r io.Reader) (interface{}, error) {
+ return func(r io.Reader) (any, error) {
if err := ReadSimpleRowHeader(1, r); err != nil {
return nil, err
}
diff --git a/sdks/go/pkg/beam/core/graph/coder/testutil/testutil.go b/sdks/go/pkg/beam/core/graph/coder/testutil/testutil.go
index 3c7acaca053..5defada8adf 100644
--- a/sdks/go/pkg/beam/core/graph/coder/testutil/testutil.go
+++ b/sdks/go/pkg/beam/core/graph/coder/testutil/testutil.go
@@ -37,7 +37,7 @@ type SchemaCoder struct {
// Register adds additional custom types not under test to both the under test
// and default schema coders.
-func (v *SchemaCoder) Register(rt reflect.Type, encF, decF interface{}) {
+func (v *SchemaCoder) Register(rt reflect.Type, encF, decF any) {
v.encBldUT.Register(rt, encF)
v.encBldSchema.Register(rt, encF)
v.decBldUT.Register(rt, decF)
@@ -49,7 +49,7 @@ func (v *SchemaCoder) Register(rt reflect.Type, encF, decF interface{}) {
type T interface {
Helper()
Run(string, func(*testing.T)) bool
- Errorf(string, ...interface{})
+ Errorf(string, ...any)
Failed() bool
FailNow()
}
@@ -71,7 +71,7 @@ type T interface {
// emulates coders being re-used for all elements within a bundle.
//
// Validate mutates the SchemaCoderValidator, so the SchemaCoderValidator may not be used more than once.
-func (v *SchemaCoder) Validate(t T, rt reflect.Type, encF, decF, schema interface{}, values interface{}) {
+func (v *SchemaCoder) Validate(t T, rt reflect.Type, encF, decF, schema any, values any) {
t.Helper()
testValues := reflect.ValueOf(values)
// Check whether we have a slice type or not.
diff --git a/sdks/go/pkg/beam/core/graph/coder/testutil/testutil_test.go b/sdks/go/pkg/beam/core/graph/coder/testutil/testutil_test.go
index f3d5309beaf..5272b224c90 100644
--- a/sdks/go/pkg/beam/core/graph/coder/testutil/testutil_test.go
+++ b/sdks/go/pkg/beam/core/graph/coder/testutil/testutil_test.go
@@ -37,7 +37,7 @@ type UserType1 struct {
func (UserType1) mark() {}
-func ut1EncDropB(val interface{}, w io.Writer) error {
+func ut1EncDropB(val any, w io.Writer) error {
if err := coder.WriteSimpleRowHeader(2, w); err != nil {
return err
}
@@ -51,7 +51,7 @@ func ut1EncDropB(val interface{}, w io.Writer) error {
return nil
}
-func ut1DecDropB(r io.Reader) (interface{}, error) {
+func ut1DecDropB(r io.Reader) (any, error) {
if err := coder.ReadSimpleRowHeader(2, r); err != nil {
return nil, err
}
@@ -79,8 +79,8 @@ func TestValidateCoder(t *testing.T) {
// always setting it to a constant value.
t.Run("SingleValue", func(t *testing.T) {
(&SchemaCoder{}).Validate(t, reflect.TypeOf((*UserType1)(nil)).Elem(),
- func(reflect.Type) (func(interface{}, io.Writer) error, error) { return ut1EncDropB, nil },
- func(reflect.Type) (func(io.Reader) (interface{}, error), error) { return ut1DecDropB, nil },
+ func(reflect.Type) (func(any, io.Writer) error, error) { return ut1EncDropB, nil },
+ func(reflect.Type) (func(io.Reader) (any, error), error) { return ut1DecDropB, nil },
struct{ A, C string }{},
UserType1{
A: "cats",
@@ -91,8 +91,8 @@ func TestValidateCoder(t *testing.T) {
})
t.Run("SliceOfValues", func(t *testing.T) {
(&SchemaCoder{}).Validate(t, reflect.TypeOf((*UserType1)(nil)).Elem(),
- func(reflect.Type) (func(interface{}, io.Writer) error, error) { return ut1EncDropB, nil },
- func(reflect.Type) (func(io.Reader) (interface{}, error), error) { return ut1DecDropB, nil },
+ func(reflect.Type) (func(any, io.Writer) error, error) { return ut1EncDropB, nil },
+ func(reflect.Type) (func(io.Reader) (any, error), error) { return ut1DecDropB, nil },
struct{ A, C string }{},
[]UserType1{
{
@@ -113,10 +113,10 @@ func TestValidateCoder(t *testing.T) {
})
t.Run("InterfaceCoder", func(t *testing.T) {
(&SchemaCoder{}).Validate(t, reflect.TypeOf((*UserInterface)(nil)).Elem(),
- func(rt reflect.Type) (func(interface{}, io.Writer) error, error) {
+ func(rt reflect.Type) (func(any, io.Writer) error, error) {
return ut1EncDropB, nil
},
- func(rt reflect.Type) (func(io.Reader) (interface{}, error), error) {
+ func(rt reflect.Type) (func(io.Reader) (any, error), error) {
return ut1DecDropB, nil
},
struct{ A, C string }{},
@@ -133,12 +133,12 @@ func TestValidateCoder(t *testing.T) {
var v SchemaCoder
// Register the pointer type to the default encoder too.
v.Register(reflect.TypeOf((*UserType2)(nil)),
- func(reflect.Type) (func(interface{}, io.Writer) error, error) { return nil, err },
- func(reflect.Type) (func(io.Reader) (interface{}, error), error) { return nil, err },
+ func(reflect.Type) (func(any, io.Writer) error, error) { return nil, err },
+ func(reflect.Type) (func(io.Reader) (any, error), error) { return nil, err },
)
v.Validate(&c, reflect.TypeOf((*UserType1)(nil)).Elem(),
- func(reflect.Type) (func(interface{}, io.Writer) error, error) { return ut1EncDropB, err },
- func(reflect.Type) (func(io.Reader) (interface{}, error), error) { return ut1DecDropB, err },
+ func(reflect.Type) (func(any, io.Writer) error, error) { return ut1EncDropB, err },
+ func(reflect.Type) (func(io.Reader) (any, error), error) { return ut1DecDropB, err },
struct {
A, C string
B *UserType2 // To trigger the bad factory registered earlier.
@@ -168,7 +168,7 @@ func TestValidateCoder(t *testing.T) {
type msg struct {
fmt string
- params []interface{}
+ params []any
}
type checker struct {
@@ -185,7 +185,7 @@ func (c *checker) Run(string, func(*testing.T)) bool {
return true
}
-func (c *checker) Errorf(fmt string, params ...interface{}) {
+func (c *checker) Errorf(fmt string, params ...any) {
c.errors = append(c.errors, msg{
fmt: fmt,
params: params,
diff --git a/sdks/go/pkg/beam/core/graph/fn.go b/sdks/go/pkg/beam/core/graph/fn.go
index 4c7f57d1d70..907af4045b5 100644
--- a/sdks/go/pkg/beam/core/graph/fn.go
+++ b/sdks/go/pkg/beam/core/graph/fn.go
@@ -34,7 +34,7 @@ type Fn struct {
Fn *funcx.Fn
// Recv hold the struct receiver, if present. If Recv is nil, Fn
// must be non-nil.
- Recv interface{}
+ Recv any
// DynFn holds the function-generator, if dynamic. If not nil, Fn
// holds the generated function.
DynFn *DynFn
@@ -78,7 +78,7 @@ type DynFn struct {
// NewFn pre-processes a function, dynamic function or struct for graph
// construction.
-func NewFn(fn interface{}) (*Fn, error) {
+func NewFn(fn any) (*Fn, error) {
if gen, ok := fn.(*DynFn); ok {
f, err := funcx.New(gen.Gen(gen.Name, gen.T, gen.Data))
if err != nil {
@@ -438,7 +438,7 @@ func CoGBKMainInput(components int) func(*config) {
}
// NewDoFn constructs a DoFn from the given value, if possible.
-func NewDoFn(fn interface{}, options ...func(*config)) (*DoFn, error) {
+func NewDoFn(fn any, options ...func(*config)) (*DoFn, error) {
ret, err := NewFn(fn)
if err != nil {
return nil, errors.WithContext(errors.Wrapf(err, "invalid DoFn"), "constructing DoFn")
@@ -1357,7 +1357,7 @@ func (f *CombineFn) Name() string {
}
// NewCombineFn constructs a CombineFn from the given value, if possible.
-func NewCombineFn(fn interface{}) (*CombineFn, error) {
+func NewCombineFn(fn any) (*CombineFn, error) {
ret, err := NewFn(fn)
if err != nil {
return nil, errors.WithContext(errors.Wrapf(err, "invalid CombineFn"), "constructing CombineFn")
diff --git a/sdks/go/pkg/beam/core/graph/fn_test.go b/sdks/go/pkg/beam/core/graph/fn_test.go
index c98a390cabf..d2f88a8a5ce 100644
--- a/sdks/go/pkg/beam/core/graph/fn_test.go
+++ b/sdks/go/pkg/beam/core/graph/fn_test.go
@@ -33,7 +33,7 @@ import (
func TestNewDoFn(t *testing.T) {
t.Run("valid", func(t *testing.T) {
tests := []struct {
- dfn interface{}
+ dfn any
opt func(*config)
}{
{dfn: func(string) int { return 0 }, opt: NumMainInputs(MainSingle)},
@@ -78,7 +78,7 @@ func TestNewDoFn(t *testing.T) {
})
t.Run("invalid", func(t *testing.T) {
tests := []struct {
- dfn interface{}
+ dfn any
numInputs int
}{
// Validate main inputs.
@@ -149,7 +149,7 @@ func TestNewDoFn(t *testing.T) {
// inputs is unknown, but fails when it's specified.
t.Run("invalidWithKnownKvs", func(t *testing.T) {
tests := []struct {
- dfn interface{}
+ dfn any
main mainInputs
}{
{dfn: func(int) int { return 0 }, main: MainKv}, // Not enough inputs.
@@ -185,7 +185,7 @@ func TestNewDoFn(t *testing.T) {
func TestNewDoFnSdf(t *testing.T) {
t.Run("valid", func(t *testing.T) {
tests := []struct {
- dfn interface{}
+ dfn any
main mainInputs
}{
{dfn: &GoodSdf{}, main: MainSingle},
@@ -207,7 +207,7 @@ func TestNewDoFnSdf(t *testing.T) {
})
t.Run("invalid", func(t *testing.T) {
tests := []struct {
- dfn interface{}
+ dfn any
}{
// Validate missing SDF methods cause errors.
{dfn: &BadSdfMissingMethods{}},
@@ -268,7 +268,7 @@ func TestNewDoFnSdf(t *testing.T) {
func TestNewDoFnWatermarkEstimating(t *testing.T) {
t.Run("valid", func(t *testing.T) {
tests := []struct {
- dfn interface{}
+ dfn any
main mainInputs
}{
{dfn: &GoodWatermarkEstimating{}, main: MainSingle},
@@ -292,7 +292,7 @@ func TestNewDoFnWatermarkEstimating(t *testing.T) {
})
t.Run("invalid", func(t *testing.T) {
tests := []struct {
- dfn interface{}
+ dfn any
}{
{dfn: &BadWatermarkEstimatingNonSdf{}},
{dfn: &BadWatermarkEstimatingCreateWatermarkEstimatorReturnType{}},
@@ -338,7 +338,7 @@ func TestNewDoFnWatermarkEstimating(t *testing.T) {
func TestNewCombineFn(t *testing.T) {
t.Run("valid", func(t *testing.T) {
tests := []struct {
- cfn interface{}
+ cfn any
}{
{cfn: func(int, int) int { return 0 }},
{cfn: func(string, string) string { return "" }},
@@ -363,7 +363,7 @@ func TestNewCombineFn(t *testing.T) {
})
t.Run("invalid", func(t *testing.T) {
tests := []struct {
- cfn interface{}
+ cfn any
}{
// Validate MergeAccumulator errors
{cfn: func() int { return 0 }},
@@ -409,7 +409,7 @@ func TestNewCombineFn(t *testing.T) {
func TestNewFn_DoFn(t *testing.T) {
// Validate wrap fallthrough
- reflectx.RegisterStructWrapper(reflect.TypeOf((*GoodDoFn)(nil)).Elem(), func(fn interface{}) map[string]reflectx.Func {
+ reflectx.RegisterStructWrapper(reflect.TypeOf((*GoodDoFn)(nil)).Elem(), func(fn any) map[string]reflectx.Func {
gdf := fn.(*GoodDoFn)
return map[string]reflectx.Func{
processElementName: reflectx.MakeFunc1x1(func(v int) int {
@@ -888,13 +888,13 @@ func (fn *BadDoFnAmbiguousSideInput) FinishBundle(bool) {
type RestT struct{}
type RTrackerT struct{}
-func (rt *RTrackerT) TryClaim(interface{}) bool {
+func (rt *RTrackerT) TryClaim(any) bool {
return true
}
func (rt *RTrackerT) GetError() error {
return nil
}
-func (rt *RTrackerT) TrySplit(fraction float64) (interface{}, interface{}, error) {
+func (rt *RTrackerT) TrySplit(fraction float64) (any, any, error) {
return nil, nil, nil
}
func (rt *RTrackerT) GetProgress() (float64, float64) {
@@ -903,7 +903,7 @@ func (rt *RTrackerT) GetProgress() (float64, float64) {
func (rt *RTrackerT) IsDone() bool {
return true
}
-func (rt *RTrackerT) GetRestriction() interface{} {
+func (rt *RTrackerT) GetRestriction() any {
return nil
}
func (rt *RTrackerT) IsBounded() bool {
@@ -912,13 +912,13 @@ func (rt *RTrackerT) IsBounded() bool {
type RTracker2T struct{}
-func (rt *RTracker2T) TryClaim(interface{}) bool {
+func (rt *RTracker2T) TryClaim(any) bool {
return false
}
func (rt *RTracker2T) GetError() error {
return nil
}
-func (rt *RTracker2T) TrySplit(fraction float64) (interface{}, interface{}, error) {
+func (rt *RTracker2T) TrySplit(fraction float64) (any, any, error) {
return nil, nil, nil
}
func (rt *RTracker2T) GetProgress() (float64, float64) {
@@ -927,7 +927,7 @@ func (rt *RTracker2T) GetProgress() (float64, float64) {
func (rt *RTracker2T) IsDone() bool {
return true
}
-func (rt *RTracker2T) GetRestriction() interface{} {
+func (rt *RTracker2T) GetRestriction() any {
return nil
}
diff --git a/sdks/go/pkg/beam/core/graph/xlang.go b/sdks/go/pkg/beam/core/graph/xlang.go
index 964d271c3de..8d2d0b324ef 100644
--- a/sdks/go/pkg/beam/core/graph/xlang.go
+++ b/sdks/go/pkg/beam/core/graph/xlang.go
@@ -48,11 +48,11 @@ func init() {
// ExpandedTransform stores the expansion response associated to each
// ExternalTransform.
//
-// Components and Transform fields are purposely typed as interface{} to avoid
+// Components and Transform fields are purposely typed as any to avoid
// unnecesary proto related imports into graph.
type ExpandedTransform struct {
- Components interface{} // *pipepb.Components
- Transform interface{} //*pipepb.PTransform
+ Components any // *pipepb.Components
+ Transform any //*pipepb.PTransform
Requirements []string
}
diff --git a/sdks/go/pkg/beam/core/metrics/dumper.go b/sdks/go/pkg/beam/core/metrics/dumper.go
index 26f6d412da4..ce8bb37c39f 100644
--- a/sdks/go/pkg/beam/core/metrics/dumper.go
+++ b/sdks/go/pkg/beam/core/metrics/dumper.go
@@ -37,7 +37,7 @@ func DumpToLog(ctx context.Context) {
// DumpToLogFromStore dumps the metrics in the provided Store to beam.Log.
func DumpToLogFromStore(ctx context.Context, store *Store) {
- dumperExtractor(store, func(format string, args ...interface{}) {
+ dumperExtractor(store, func(format string, args ...any) {
log.Errorf(ctx, format, args...)
})
}
@@ -57,13 +57,13 @@ func DumpToOutFromContext(ctx context.Context) {
// DumpToOutFromStore is a debugging function that outputs all metrics
// available locally to std out directly from the store.
func DumpToOutFromStore(store *Store) {
- dumperExtractor(store, func(format string, args ...interface{}) {
+ dumperExtractor(store, func(format string, args ...any) {
fmt.Printf(format+"\n", args...)
})
}
-func dumperExtractor(store *Store, p func(format string, args ...interface{})) {
- m := make(map[Labels]interface{})
+func dumperExtractor(store *Store, p func(format string, args ...any)) {
+ m := make(map[Labels]any)
e := &Extractor{
SumInt64: func(l Labels, v int64) {
m[l] = &counter{value: v}
@@ -80,7 +80,7 @@ func dumperExtractor(store *Store, p func(format string, args ...interface{})) {
dumpTo(m, p)
}
-func dumpTo(store map[Labels]interface{}, p func(format string, args ...interface{})) {
+func dumpTo(store map[Labels]any, p func(format string, args ...any)) {
var ls []Labels
for l := range store {
ls = append(ls, l)
diff --git a/sdks/go/pkg/beam/core/metrics/dumper_test.go b/sdks/go/pkg/beam/core/metrics/dumper_test.go
index e618354eda8..750de210e1c 100644
--- a/sdks/go/pkg/beam/core/metrics/dumper_test.go
+++ b/sdks/go/pkg/beam/core/metrics/dumper_test.go
@@ -25,7 +25,7 @@ import (
func TestDumperExtractor(t *testing.T) {
var got []string
- printer := func(format string, args ...interface{}) {
+ printer := func(format string, args ...any) {
got = append(got, fmt.Sprintf(format, args...))
}
diff --git a/sdks/go/pkg/beam/core/metrics/metrics.go b/sdks/go/pkg/beam/core/metrics/metrics.go
index 78a4a852b2f..678a34a647d 100644
--- a/sdks/go/pkg/beam/core/metrics/metrics.go
+++ b/sdks/go/pkg/beam/core/metrics/metrics.go
@@ -84,7 +84,7 @@ type beamCtx struct {
// Value implements the Context interface Value method for beamCtx.
// The implementation lifts the stored values for metrics keys to the
// top level beamCtx for faster lookups.
-func (ctx *beamCtx) Value(key interface{}) interface{} {
+func (ctx *beamCtx) Value(key any) any {
switch key {
case counterSetKey:
if ctx.cs == nil {
@@ -890,7 +890,7 @@ func MergeMsecs(
// This is same as what metrics.dumperExtractor and metrics.dumpTo would do together.
func ResultsExtractor(ctx context.Context) Results {
store := GetStore(ctx)
- m := make(map[Labels]interface{})
+ m := make(map[Labels]any)
e := &Extractor{
SumInt64: func(l Labels, v int64) {
m[l] = &counter{value: v}
diff --git a/sdks/go/pkg/beam/core/metrics/store_test.go b/sdks/go/pkg/beam/core/metrics/store_test.go
index dcdadad7429..60525ecb21a 100644
--- a/sdks/go/pkg/beam/core/metrics/store_test.go
+++ b/sdks/go/pkg/beam/core/metrics/store_test.go
@@ -23,7 +23,7 @@ import (
func TestStore(t *testing.T) {
store := newStore()
- m := make(map[Labels]interface{})
+ m := make(map[Labels]any)
e := &Extractor{
SumInt64: func(l Labels, v int64) {
m[l] = &counter{value: v}
@@ -51,7 +51,7 @@ func TestStore(t *testing.T) {
t.Fatalf("e.ExtractFrom(store) = %q, want nil", err)
}
- expected := map[Labels]interface{}{
+ expected := map[Labels]any{
{transform: "pid", namespace: "ns", name: "counter"}: &counter{value: 1},
{transform: "pid", namespace: "ns", name: "distribution"}: &distribution{count: 1, sum: 2, min: 3, max: 4},
{transform: "pid", namespace: "ns", name: "gauge"}: &gauge{v: 1, t: now},
diff --git a/sdks/go/pkg/beam/core/runtime/coderx/float_test.go b/sdks/go/pkg/beam/core/runtime/coderx/float_test.go
index 76e1a34eaa1..abdb2d506fc 100644
--- a/sdks/go/pkg/beam/core/runtime/coderx/float_test.go
+++ b/sdks/go/pkg/beam/core/runtime/coderx/float_test.go
@@ -23,7 +23,7 @@ import (
)
func TestFloat(t *testing.T) {
- tests := []interface{}{
+ tests := []any{
float32(0.0),
float32(94.5),
float64(-127.25),
diff --git a/sdks/go/pkg/beam/core/runtime/coderx/string_test.go b/sdks/go/pkg/beam/core/runtime/coderx/string_test.go
index 82cd14d41e9..c51026a4418 100644
--- a/sdks/go/pkg/beam/core/runtime/coderx/string_test.go
+++ b/sdks/go/pkg/beam/core/runtime/coderx/string_test.go
@@ -20,7 +20,7 @@ import (
)
func TestString(t *testing.T) {
- tests := []interface{}{
+ tests := []any{
"",
"A novel set of characters",
"Hello, 世界",
diff --git a/sdks/go/pkg/beam/core/runtime/coderx/varint_test.go b/sdks/go/pkg/beam/core/runtime/coderx/varint_test.go
index b426b1ac4bf..2bb9fe36495 100644
--- a/sdks/go/pkg/beam/core/runtime/coderx/varint_test.go
+++ b/sdks/go/pkg/beam/core/runtime/coderx/varint_test.go
@@ -23,7 +23,7 @@ import (
)
func TestVarIntZ(t *testing.T) {
- tests := []interface{}{
+ tests := []any{
int(1),
int(-1),
int8(8),
@@ -56,7 +56,7 @@ func TestVarIntZ(t *testing.T) {
}
func TestVarUintZ(t *testing.T) {
- tests := []interface{}{
+ tests := []any{
uint(1),
uint8(8),
uint16(16),
diff --git a/sdks/go/pkg/beam/core/runtime/exec/coder.go b/sdks/go/pkg/beam/core/runtime/exec/coder.go
index 5adaddd28ae..39248f7f5ac 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/coder.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/coder.go
@@ -44,7 +44,7 @@ type ElementEncoder interface {
// EncodeElement is a convenience function for encoding a single element into a
// byte slice.
-func EncodeElement(c ElementEncoder, val interface{}) ([]byte, error) {
+func EncodeElement(c ElementEncoder, val any) ([]byte, error) {
var buf bytes.Buffer
if err := c.Encode(&FullValue{Elm: val}, &buf); err != nil {
return nil, err
@@ -610,7 +610,7 @@ func (c *kvDecoder) Decode(r io.Reader) (*FullValue, error) {
//
// Technically drops window and timestamp info, so only use when those are
// expected to be empty.
-func elideSingleElmFV(fv *FullValue) interface{} {
+func elideSingleElmFV(fv *FullValue) any {
if fv.Elm2 == nil {
return fv.Elm
}
@@ -619,7 +619,7 @@ func elideSingleElmFV(fv *FullValue) interface{} {
// convertIfNeeded reuses Wrapped KVs if needed, but accepts pointer
// to a pre-allocated non-nil *FullValue for overwriting and use.
-func convertIfNeeded(v interface{}, allocated *FullValue) *FullValue {
+func convertIfNeeded(v any, allocated *FullValue) *FullValue {
if fv, ok := v.(*FullValue); ok {
return fv
} else if _, ok := v.(FullValue); ok {
@@ -953,7 +953,7 @@ func (d *paneDecoder) Decode(r io.Reader) (*FullValue, error) {
}
type rowEncoder struct {
- enc func(interface{}, io.Writer) error
+ enc func(any, io.Writer) error
}
func (e *rowEncoder) Encode(val *FullValue, w io.Writer) error {
@@ -961,7 +961,7 @@ func (e *rowEncoder) Encode(val *FullValue, w io.Writer) error {
}
type rowDecoder struct {
- dec func(r io.Reader) (interface{}, error)
+ dec func(r io.Reader) (any, error)
}
func (d *rowDecoder) DecodeTo(r io.Reader, fv *FullValue) error {
diff --git a/sdks/go/pkg/beam/core/runtime/exec/combine.go b/sdks/go/pkg/beam/core/runtime/exec/combine.go
index 9ca77ec54ff..7c4948875d3 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/combine.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/combine.go
@@ -50,7 +50,7 @@ type Combine struct {
// reusable invokers
createAccumInv, addInputInv, mergeInv, extractOutputInv *invoker
// cached value converter for add input.
- aiValConvert func(interface{}) interface{}
+ aiValConvert func(any) any
states *metrics.PTransformState
}
@@ -100,7 +100,7 @@ func (n *Combine) optimizeMergeFn() {
}
}
-func (n *Combine) mergeAccumulators(ctx context.Context, a, b interface{}) (interface{}, error) {
+func (n *Combine) mergeAccumulators(ctx context.Context, a, b any) (any, error) {
if n.binaryMergeFn != nil {
// Fast path for binary MergeAccumulatorsFn
return n.binaryMergeFn.Call2x1(a, b), nil
@@ -219,7 +219,7 @@ func (n *Combine) Down(ctx context.Context) error {
return n.err.Error()
}
-func (n *Combine) newAccum(ctx context.Context, key interface{}) (interface{}, error) {
+func (n *Combine) newAccum(ctx context.Context, key any) (any, error) {
fn := n.Fn.CreateAccumulatorFn()
if fn == nil {
return reflect.Zero(n.Fn.MergeAccumulatorsFn().Ret[0].T).Interface(), nil
@@ -237,7 +237,7 @@ func (n *Combine) newAccum(ctx context.Context, key interface{}) (interface{}, e
return val.Elm, nil
}
-func (n *Combine) addInput(ctx context.Context, accum, key, value interface{}, timestamp typex.EventTime, first bool) (interface{}, error) {
+func (n *Combine) addInput(ctx context.Context, accum, key, value any, timestamp typex.EventTime, first bool) (any, error) {
// log.Printf("AddInput: %v %v into %v", key, value, accum)
fn := n.Fn.AddInputFn()
@@ -280,7 +280,7 @@ func (n *Combine) addInput(ctx context.Context, accum, key, value interface{}, t
return val.Elm, err
}
-func (n *Combine) extract(ctx context.Context, accum interface{}) (interface{}, error) {
+func (n *Combine) extract(ctx context.Context, accum any) (any, error) {
fn := n.Fn.ExtractOutputFn()
if fn == nil {
// Merge function only. Accumulator type is the output type.
@@ -380,7 +380,7 @@ func (n *LiftedCombine) processElementPerWindow(ctx context.Context, value *Full
return n.fail(err)
}
- var a interface{}
+ var a any
if notfirst {
a = afv.Elm2
} else {
diff --git a/sdks/go/pkg/beam/core/runtime/exec/combine_test.go b/sdks/go/pkg/beam/core/runtime/exec/combine_test.go
index 2457144ed51..4e55a4cf855 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/combine_test.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/combine_test.go
@@ -33,15 +33,15 @@ import (
"github.com/apache/beam/sdks/v2/go/pkg/beam/internal/errors"
)
-var intInput = []interface{}{int(1), int(2), int(3), int(4), int(5), int(6)}
-var int64Input = []interface{}{int64(1), int64(2), int64(3), int64(4), int64(5), int64(6)}
-var strInput = []interface{}{"1", "2", "3", "4", "5", "6"}
+var intInput = []any{int(1), int(2), int(3), int(4), int(5), int(6)}
+var int64Input = []any{int64(1), int64(2), int64(3), int64(4), int64(5), int64(6)}
+var strInput = []any{"1", "2", "3", "4", "5", "6"}
var tests = []struct {
- Fn interface{}
+ Fn any
AccumCoder *coder.Coder
- Input []interface{}
- Expected interface{}
+ Input []any
+ Expected any
}{
{Fn: mergeFn, AccumCoder: intCoder(reflectx.Int), Input: intInput, Expected: int(21)},
{Fn: nonBinaryMergeFn, AccumCoder: intCoder(reflectx.Int), Input: intInput, Expected: int(21)},
@@ -52,7 +52,7 @@ var tests = []struct {
{Fn: &MyErrorCombine{}, AccumCoder: intCoder(reflectx.Int64), Input: intInput, Expected: int(21)},
}
-func fnName(x interface{}) string {
+func fnName(x any) string {
v := reflect.ValueOf(x)
if v.Kind() != reflect.Func {
return v.Type().String()
@@ -83,7 +83,7 @@ func TestCombine(t *testing.T) {
// TestLiftedCombine verifies that the LiftedCombine, MergeAccumulators, and
// ExtractOutput nodes work correctly after the lift has been performed.
func TestLiftedCombine(t *testing.T) {
- withCoder := func(t *testing.T, suffix string, key interface{}, keyCoder *coder.Coder) {
+ withCoder := func(t *testing.T, suffix string, key any, keyCoder *coder.Coder) {
// The test values are all single global window.
wc := coder.NewGlobalWindow()
for _, test := range tests {
@@ -122,7 +122,7 @@ type pigeonHasher struct {
hasher elementHasher
}
-func (p *pigeonHasher) Hash(element interface{}, w typex.Window) (uint64, error) {
+func (p *pigeonHasher) Hash(element any, w typex.Window) (uint64, error) {
k, err := p.hasher.Hash(element, w)
if err != nil {
return 0, err
@@ -316,10 +316,10 @@ func TestLiftingCache(t *testing.T) {
// correctly doesn't accumulate values at all.
func TestConvertToAccumulators(t *testing.T) {
tests := []struct {
- Fn interface{}
+ Fn any
AccumCoder *coder.Coder
- Input []interface{}
- Expected []interface{}
+ Input []any
+ Expected []any
}{
{Fn: mergeFn, AccumCoder: intCoder(reflectx.Int), Input: intInput, Expected: intInput},
{Fn: nonBinaryMergeFn, AccumCoder: intCoder(reflectx.Int), Input: intInput, Expected: intInput},
@@ -385,7 +385,7 @@ func (c *myCodable) DecodeMe(b []byte) {
c.val = binary.LittleEndian.Uint64(b)
}
-func getCombineEdge(t *testing.T, cfn interface{}, kt reflect.Type, ac *coder.Coder) *graph.MultiEdge {
+func getCombineEdge(t *testing.T, cfn any, kt reflect.Type, ac *coder.Coder) *graph.MultiEdge {
t.Helper()
fn, err := graph.NewCombineFn(cfn)
if err != nil {
diff --git a/sdks/go/pkg/beam/core/runtime/exec/datasource_test.go b/sdks/go/pkg/beam/core/runtime/exec/datasource_test.go
index 46c00e68ee8..970dbb95b4d 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/datasource_test.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/datasource_test.go
@@ -34,15 +34,15 @@ import (
func TestDataSource_PerElement(t *testing.T) {
tests := []struct {
name string
- expected []interface{}
+ expected []any
Coder *coder.Coder
- driver func(*coder.Coder, io.WriteCloser, []interface{})
+ driver func(*coder.Coder, io.WriteCloser, []any)
}{
{
name: "perElement",
- expected: []interface{}{int64(1), int64(2), int64(3), int64(4), int64(5)},
+ expected: []any{int64(1), int64(2), int64(3), int64(4), int64(5)},
Coder: coder.NewW(coder.NewVarInt(), coder.NewGlobalWindow()),
- driver: func(c *coder.Coder, pw io.WriteCloser, expected []interface{}) {
+ driver: func(c *coder.Coder, pw io.WriteCloser, expected []any) {
wc := MakeWindowEncoder(c.Window)
ec := MakeElementEncoder(coder.SkipW(c))
for _, v := range expected {
@@ -89,16 +89,16 @@ func TestDataSource_Iterators(t *testing.T) {
tests := []struct {
name string
- keys, vals []interface{}
+ keys, vals []any
Coder *coder.Coder
- driver func(c *coder.Coder, dmw io.WriteCloser, siwFn func() io.WriteCloser, ks, vs []interface{})
+ driver func(c *coder.Coder, dmw io.WriteCloser, siwFn func() io.WriteCloser, ks, vs []any)
}{
{
name: "beam:coder:iterable:v1-singleChunk",
- keys: []interface{}{int64(42), int64(53)},
- vals: []interface{}{int64(1), int64(2), int64(3), int64(4), int64(5)},
+ keys: []any{int64(42), int64(53)},
+ vals: []any{int64(1), int64(2), int64(3), int64(4), int64(5)},
Coder: coder.NewW(coder.NewCoGBK([]*coder.Coder{coder.NewVarInt(), coder.NewVarInt()}), coder.NewGlobalWindow()),
- driver: func(c *coder.Coder, dmw io.WriteCloser, _ func() io.WriteCloser, ks, vs []interface{}) {
+ driver: func(c *coder.Coder, dmw io.WriteCloser, _ func() io.WriteCloser, ks, vs []any) {
wc, kc, vc := extractCoders(c)
for _, k := range ks {
EncodeWindowedValueHeader(wc, window.SingleGlobalWindow, mtime.ZeroTimestamp, typex.NoFiringPane(), dmw)
@@ -113,10 +113,10 @@ func TestDataSource_Iterators(t *testing.T) {
},
{
name: "beam:coder:iterable:v1-multiChunk",
- keys: []interface{}{int64(42), int64(53)},
- vals: []interface{}{int64(1), int64(2), int64(3), int64(4), int64(5)},
+ keys: []any{int64(42), int64(53)},
+ vals: []any{int64(1), int64(2), int64(3), int64(4), int64(5)},
Coder: coder.NewW(coder.NewCoGBK([]*coder.Coder{coder.NewVarInt(), coder.NewVarInt()}), coder.NewGlobalWindow()),
- driver: func(c *coder.Coder, dmw io.WriteCloser, _ func() io.WriteCloser, ks, vs []interface{}) {
+ driver: func(c *coder.Coder, dmw io.WriteCloser, _ func() io.WriteCloser, ks, vs []any) {
wc, kc, vc := extractCoders(c)
for _, k := range ks {
EncodeWindowedValueHeader(wc, window.SingleGlobalWindow, mtime.ZeroTimestamp, typex.NoFiringPane(), dmw)
@@ -134,10 +134,10 @@ func TestDataSource_Iterators(t *testing.T) {
},
{
name: "beam:coder:state_backed_iterable:v1",
- keys: []interface{}{int64(42), int64(53)},
- vals: []interface{}{int64(1), int64(2), int64(3), int64(4), int64(5)},
+ keys: []any{int64(42), int64(53)},
+ vals: []any{int64(1), int64(2), int64(3), int64(4), int64(5)},
Coder: coder.NewW(coder.NewCoGBK([]*coder.Coder{coder.NewVarInt(), coder.NewVarInt()}), coder.NewGlobalWindow()),
- driver: func(c *coder.Coder, dmw io.WriteCloser, swFn func() io.WriteCloser, ks, vs []interface{}) {
+ driver: func(c *coder.Coder, dmw io.WriteCloser, swFn func() io.WriteCloser, ks, vs []any) {
wc, kc, vc := extractCoders(c)
for _, k := range ks {
EncodeWindowedValueHeader(wc, window.SingleGlobalWindow, mtime.ZeroTimestamp, typex.NoFiringPane(), dmw)
@@ -232,7 +232,7 @@ func TestDataSource_Iterators(t *testing.T) {
}
func TestDataSource_Split(t *testing.T) {
- elements := []interface{}{int64(1), int64(2), int64(3), int64(4), int64(5)}
+ elements := []any{int64(1), int64(2), int64(3), int64(4), int64(5)}
initSourceTest := func(name string) (*DataSource, *CaptureNode, io.ReadCloser) {
out := &CaptureNode{UID: 1}
c := coder.NewW(coder.NewVarInt(), coder.NewGlobalWindow())
@@ -245,7 +245,7 @@ func TestDataSource_Split(t *testing.T) {
}
pr, pw := io.Pipe()
- go func(c *coder.Coder, pw io.WriteCloser, elements []interface{}) {
+ go func(c *coder.Coder, pw io.WriteCloser, elements []any) {
wc := MakeWindowEncoder(c.Window)
ec := MakeElementEncoder(coder.SkipW(c))
for _, v := range elements {
@@ -259,7 +259,7 @@ func TestDataSource_Split(t *testing.T) {
tests := []struct {
name string
- expected []interface{}
+ expected []any
splitIdx int64
}{
{splitIdx: 1},
@@ -325,7 +325,7 @@ func TestDataSource_Split(t *testing.T) {
// Check splitting *while* elements are in process.
tests := []struct {
name string
- expected []interface{}
+ expected []any
splitIdx int64
}{
{splitIdx: 1},
@@ -406,7 +406,7 @@ func TestDataSource_Split(t *testing.T) {
frac float64
bufSize int64
splitIdx int64
- expected []interface{}
+ expected []any
}{
// splitIdx defaults to the max int64, so if bufSize is respected
// the closest splitPt is 3, otherwise it'll be 5000.
@@ -610,7 +610,7 @@ const testInputId = "input_id"
// TestSplittableUnit is an implementation of the SplittableUnit interface
// for DataSource tests.
type TestSplittableUnit struct {
- elm interface{} // The element to split.
+ elm any // The element to split.
}
// Split checks the input fraction for correctness, but otherwise always returns
diff --git a/sdks/go/pkg/beam/core/runtime/exec/decode.go b/sdks/go/pkg/beam/core/runtime/exec/decode.go
index 90d0c955b2e..1bae4d7d1b8 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/decode.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/decode.go
@@ -26,7 +26,7 @@ import (
// forms of reflectx.Funcs.
type Decoder interface {
// Decode decodes the []byte in to a value of the given type.
- Decode(reflect.Type, []byte) (interface{}, error)
+ Decode(reflect.Type, []byte) (any, error)
}
func makeDecoder(fn reflectx.Func) Decoder {
@@ -65,7 +65,7 @@ type decoder1x1 struct {
fn reflectx.Func1x1
}
-func (d *decoder1x1) Decode(t reflect.Type, data []byte) (interface{}, error) {
+func (d *decoder1x1) Decode(t reflect.Type, data []byte) (any, error) {
return d.fn.Call1x1(data), nil
}
@@ -73,7 +73,7 @@ type decoder1x2 struct {
fn reflectx.Func1x2
}
-func (d *decoder1x2) Decode(t reflect.Type, data []byte) (interface{}, error) {
+func (d *decoder1x2) Decode(t reflect.Type, data []byte) (any, error) {
val, err := d.fn.Call1x2(data)
if err != nil {
return nil, err.(error)
@@ -85,7 +85,7 @@ type decoder2x1 struct {
fn reflectx.Func2x1
}
-func (d *decoder2x1) Decode(t reflect.Type, data []byte) (interface{}, error) {
+func (d *decoder2x1) Decode(t reflect.Type, data []byte) (any, error) {
return d.fn.Call2x1(t, data), nil
}
@@ -93,7 +93,7 @@ type decoder2x2 struct {
fn reflectx.Func2x2
}
-func (d *decoder2x2) Decode(t reflect.Type, data []byte) (interface{}, error) {
+func (d *decoder2x2) Decode(t reflect.Type, data []byte) (any, error) {
val, err := d.fn.Call2x2(t, data)
if err != nil {
return nil, err.(error)
diff --git a/sdks/go/pkg/beam/core/runtime/exec/dynsplit_test.go b/sdks/go/pkg/beam/core/runtime/exec/dynsplit_test.go
index cb7a6c48cb5..8318b96b301 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/dynsplit_test.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/dynsplit_test.go
@@ -370,7 +370,7 @@ func newSplitTestRTracker(rest offsetrange.Restriction) *splitTestRTracker {
}
}
-func (rt *splitTestRTracker) TryClaim(pos interface{}) bool {
+func (rt *splitTestRTracker) TryClaim(pos any) bool {
i := pos.(int64)
if i == rt.blockInd {
rt.claim <- struct{}{}
@@ -395,7 +395,7 @@ func (rt *splitTestRTracker) GetError() error {
return rt.rt.GetError()
}
-func (rt *splitTestRTracker) TrySplit(fraction float64) (interface{}, interface{}, error) {
+func (rt *splitTestRTracker) TrySplit(fraction float64) (any, any, error) {
rt.mu.Lock()
defer rt.mu.Unlock()
rt.blockSplit <- struct{}{}
@@ -418,7 +418,7 @@ func (rt *splitTestRTracker) IsDone() bool {
return rt.rt.IsDone()
}
-func (rt *splitTestRTracker) GetRestriction() interface{} {
+func (rt *splitTestRTracker) GetRestriction() any {
rt.mu.Lock()
defer rt.mu.Unlock()
return rt.rt.GetRestriction()
diff --git a/sdks/go/pkg/beam/core/runtime/exec/emit.go b/sdks/go/pkg/beam/core/runtime/exec/emit.go
index c008b0b412d..1f382a23654 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/emit.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/emit.go
@@ -32,7 +32,7 @@ type ReusableEmitter interface {
// Init resets the value. Can be called multiple times.
Init(ctx context.Context, ws []typex.Window, t typex.EventTime) error
// Value returns the side input value. Constant value.
- Value() interface{}
+ Value() any
}
// ReusableTimestampObservingWatermarkEmitter is a resettable value needed to hold
@@ -91,7 +91,7 @@ func makeEmit(t reflect.Type, n ElementProcessor) ReusableEmitter {
// emitValue is the reflection-based default emitter implementation.
type emitValue struct {
n ElementProcessor
- fn interface{}
+ fn any
types []reflect.Type
est *sdf.WatermarkEstimator
@@ -107,7 +107,7 @@ func (e *emitValue) Init(ctx context.Context, ws []typex.Window, et typex.EventT
return nil
}
-func (e *emitValue) Value() interface{} {
+func (e *emitValue) Value() any {
return e.fn
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/encode.go b/sdks/go/pkg/beam/core/runtime/exec/encode.go
index ada5d3c195a..af5e2f59700 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/encode.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/encode.go
@@ -26,7 +26,7 @@ import (
// forms of reflectx.Funcs.
type Encoder interface {
// Encode encodes the given value (of the given type).
- Encode(reflect.Type, interface{}) ([]byte, error)
+ Encode(reflect.Type, any) ([]byte, error)
}
func makeEncoder(fn reflectx.Func) Encoder {
@@ -65,7 +65,7 @@ type encoder1x1 struct {
fn reflectx.Func1x1
}
-func (d *encoder1x1) Encode(t reflect.Type, v interface{}) ([]byte, error) {
+func (d *encoder1x1) Encode(t reflect.Type, v any) ([]byte, error) {
return d.fn.Call1x1(v).([]byte), nil
}
@@ -73,7 +73,7 @@ type encoder1x2 struct {
fn reflectx.Func1x2
}
-func (d *encoder1x2) Encode(t reflect.Type, v interface{}) ([]byte, error) {
+func (d *encoder1x2) Encode(t reflect.Type, v any) ([]byte, error) {
val, err := d.fn.Call1x2(v)
if err != nil {
return nil, err.(error)
@@ -85,7 +85,7 @@ type encoder2x1 struct {
fn reflectx.Func2x1
}
-func (d *encoder2x1) Encode(t reflect.Type, v interface{}) ([]byte, error) {
+func (d *encoder2x1) Encode(t reflect.Type, v any) ([]byte, error) {
return d.fn.Call2x1(t, v).([]byte), nil
}
@@ -93,7 +93,7 @@ type encoder2x2 struct {
fn reflectx.Func2x2
}
-func (d *encoder2x2) Encode(t reflect.Type, v interface{}) ([]byte, error) {
+func (d *encoder2x2) Encode(t reflect.Type, v any) ([]byte, error) {
val, err := d.fn.Call2x2(t, v)
if err != nil {
return nil, err.(error)
diff --git a/sdks/go/pkg/beam/core/runtime/exec/fn.go b/sdks/go/pkg/beam/core/runtime/exec/fn.go
index 1f6f196bc28..eaf9df81e4a 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/fn.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/fn.go
@@ -70,7 +70,7 @@ func (bf *bundleFinalizer) RegisterCallback(t time.Duration, cb func() error) {
// Invoke invokes the fn with the given values. The extra values must match the non-main
// side input and emitters. It returns the direct output, if any.
-func Invoke(ctx context.Context, pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, fn *funcx.Fn, opt *MainInput, bf *bundleFinalizer, we sdf.WatermarkEstimator, sa UserStateAdapter, reader StateReader, extra ...interface{}) (*FullValue, error) {
+func Invoke(ctx context.Context, pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, fn *funcx.Fn, opt *MainInput, bf *bundleFinalizer, we sdf.WatermarkEstimator, sa UserStateAdapter, reader StateReader, extra ...any) (*FullValue, error) {
if fn == nil {
return nil, nil // ok: nothing to Invoke
}
@@ -79,7 +79,7 @@ func Invoke(ctx context.Context, pn typex.PaneInfo, ws []typex.Window, ts typex.
}
// InvokeWithoutEventTime runs the given function at time 0 in the global window.
-func InvokeWithoutEventTime(ctx context.Context, fn *funcx.Fn, opt *MainInput, bf *bundleFinalizer, we sdf.WatermarkEstimator, sa UserStateAdapter, reader StateReader, extra ...interface{}) (*FullValue, error) {
+func InvokeWithoutEventTime(ctx context.Context, fn *funcx.Fn, opt *MainInput, bf *bundleFinalizer, we sdf.WatermarkEstimator, sa UserStateAdapter, reader StateReader, extra ...any) (*FullValue, error) {
if fn == nil {
return nil, nil // ok: nothing to Invoke
}
@@ -91,22 +91,22 @@ func InvokeWithoutEventTime(ctx context.Context, fn *funcx.Fn, opt *MainInput, b
// repeating fixed set up per element.
type invoker struct {
fn *funcx.Fn
- args []interface{}
+ args []any
sp *stateProvider
// TODO(lostluck): 2018/07/06 consider replacing with a slice of functions to run over the args slice, as an improvement.
ctxIdx, pnIdx, wndIdx, etIdx, bfIdx, weIdx, spIdx int // specialized input indexes
outEtIdx, outPcIdx, outErrIdx int // specialized output indexes
in, out []int // general indexes
- ret FullValue // ret is a cached allocation for passing to the next Unit. Units never modify the passed in FullValue.
- elmConvert, elm2Convert func(interface{}) interface{} // Cached conversion functions, which assums this invoker is always used with the same parameter types.
+ ret FullValue // ret is a cached allocation for passing to the next Unit. Units never modify the passed in FullValue.
+ elmConvert, elm2Convert func(any) any // Cached conversion functions, which assums this invoker is always used with the same parameter types.
call func(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime) (*FullValue, error)
}
func newInvoker(fn *funcx.Fn) *invoker {
n := &invoker{
fn: fn,
- args: make([]interface{}, len(fn.Param)),
+ args: make([]any, len(fn.Param)),
in: fn.Params(funcx.FnValue | funcx.FnIter | funcx.FnReIter | funcx.FnEmit | funcx.FnMultiMap | funcx.FnRTracker),
out: fn.Returns(funcx.RetValue),
}
@@ -157,13 +157,13 @@ func (n *invoker) Reset() {
}
// InvokeWithoutEventTime runs the function at time 0 in the global window.
-func (n *invoker) InvokeWithoutEventTime(ctx context.Context, opt *MainInput, bf *bundleFinalizer, we sdf.WatermarkEstimator, sa UserStateAdapter, reader StateReader, extra ...interface{}) (*FullValue, error) {
+func (n *invoker) InvokeWithoutEventTime(ctx context.Context, opt *MainInput, bf *bundleFinalizer, we sdf.WatermarkEstimator, sa UserStateAdapter, reader StateReader, extra ...any) (*FullValue, error) {
return n.Invoke(ctx, typex.NoFiringPane(), window.SingleGlobalWindow, mtime.ZeroTimestamp, opt, bf, we, sa, reader, extra...)
}
// Invoke invokes the fn with the given values. The extra values must match the non-main
// side input and emitters. It returns the direct output, if any.
-func (n *invoker) Invoke(ctx context.Context, pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, opt *MainInput, bf *bundleFinalizer, we sdf.WatermarkEstimator, sa UserStateAdapter, reader StateReader, extra ...interface{}) (*FullValue, error) {
+func (n *invoker) Invoke(ctx context.Context, pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, opt *MainInput, bf *bundleFinalizer, we sdf.WatermarkEstimator, sa UserStateAdapter, reader StateReader, extra ...any) (*FullValue, error) {
// (1) Populate contexts
// extract these to make things easier to read.
args := n.args
@@ -254,7 +254,7 @@ func (n *invoker) Invoke(ctx context.Context, pn typex.PaneInfo, ws []typex.Wind
// ret1 handles processing of a single return value.
// Errors, single values, or a ProcessContinuation are the only options.
-func (n *invoker) ret1(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, r0 interface{}) (*FullValue, error) {
+func (n *invoker) ret1(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, r0 any) (*FullValue, error) {
switch {
case n.outErrIdx == 0:
if r0 != nil {
@@ -276,7 +276,7 @@ func (n *invoker) ret1(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime,
}
// ret2 handles processing of a pair of return values.
-func (n *invoker) ret2(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, r0, r1 interface{}) (*FullValue, error) {
+func (n *invoker) ret2(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, r0, r1 any) (*FullValue, error) {
switch {
case n.outErrIdx == 1:
if r1 != nil {
@@ -310,7 +310,7 @@ func (n *invoker) ret2(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime,
}
// ret3 handles processing of a trio of return values.
-func (n *invoker) ret3(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, r0, r1, r2 interface{}) (*FullValue, error) {
+func (n *invoker) ret3(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, r0, r1, r2 any) (*FullValue, error) {
switch {
case n.outEtIdx == 0:
if n.outErrIdx == 2 {
@@ -352,7 +352,7 @@ func (n *invoker) ret3(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime,
}
// ret4 handles processing of a quad of return values.
-func (n *invoker) ret4(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, r0, r1, r2, r3 interface{}) (*FullValue, error) {
+func (n *invoker) ret4(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, r0, r1, r2, r3 any) (*FullValue, error) {
if n.outEtIdx == 0 {
if n.outErrIdx == 3 {
if r3 != nil {
@@ -386,7 +386,7 @@ func (n *invoker) ret4(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime,
}
// ret5 handles processing five return values.
-func (n *invoker) ret5(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, r0, r1, r2, r3, r4 interface{}) (*FullValue, error) {
+func (n *invoker) ret5(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, r0, r1, r2, r3, r4 any) (*FullValue, error) {
if r4 != nil {
return nil, r4.(error)
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/fn_test.go b/sdks/go/pkg/beam/core/runtime/exec/fn_test.go
index 21ec37dc98f..dc6a06084d5 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/fn_test.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/fn_test.go
@@ -43,10 +43,10 @@ func continuationsEqual(first, second sdf.ProcessContinuation) bool {
// TestInvoke verifies the various forms of input to Invoke are handled correctly.
func TestInvoke(t *testing.T) {
tests := []struct {
- Fn interface{}
+ Fn any
Opt *MainInput
- Args []interface{}
- Expected, Expected2 interface{}
+ Args []any
+ Expected, Expected2 any
ExpectedTime typex.EventTime
ExpectedContinuation sdf.ProcessContinuation
ExpectedError error
@@ -62,25 +62,25 @@ func TestInvoke(t *testing.T) {
{
// Sum
Fn: func(a, b, c int) int { return a + b + c },
- Args: []interface{}{1, 2, 3},
+ Args: []any{1, 2, 3},
Expected: 6,
},
{
// Concat
Fn: func(a, b, c string) string { return a + b + c },
- Args: []interface{}{"a", "b", "c"},
+ Args: []any{"a", "b", "c"},
Expected: "abc",
},
{
// Length (slice type)
Fn: func(list []int) (int, error) { return len(list), nil },
- Args: []interface{}{[]int{1, 2, 3}},
+ Args: []any{[]int{1, 2, 3}},
Expected: 3,
},
{
// Emitter
Fn: func(emit func(int)) { emit(1) },
- Args: []interface{}{func(int) {}},
+ Args: []any{func(int) {}},
},
{
// Side input
@@ -91,7 +91,7 @@ func TestInvoke(t *testing.T) {
}
return ret
},
- Args: []interface{}{1, func(out *int) bool { *out = 2; return true }},
+ Args: []any{1, func(out *int) bool { *out = 2; return true }},
Expected: 2,
},
{
@@ -104,21 +104,21 @@ func TestInvoke(t *testing.T) {
}
return ret
},
- Args: []interface{}{1, func(_ int) func(*int) bool { return func(out *int) bool { *out = 2; return true } }},
+ Args: []any{1, func(_ int) func(*int) bool { return func(out *int) bool { *out = 2; return true } }},
Expected: 2,
},
{
// Sum as Main
Fn: func(a, b, c int) int { return a + b + c },
Opt: &MainInput{Key: FullValue{Elm: 1}},
- Args: []interface{}{2, 3},
+ Args: []any{2, 3},
Expected: 6,
},
{
// Sum as Main KV
Fn: func(a, b, c int) int { return a + b + c },
Opt: &MainInput{Key: FullValue{Elm: 1, Elm2: 2}},
- Args: []interface{}{3},
+ Args: []any{3},
Expected: 6,
},
{
@@ -389,10 +389,10 @@ func TestRegisterCallback(t *testing.T) {
func BenchmarkInvoke(b *testing.B) {
tests := []struct {
Name string
- Fn interface{}
+ Fn any
Opt *MainInput
- Args []interface{}
- Expected interface{}
+ Args []any
+ Expected any
}{
{
Name: "Void function",
@@ -405,25 +405,25 @@ func BenchmarkInvoke(b *testing.B) {
{
Name: "Sum",
Fn: func(a, b, c int) int { return a + b + c },
- Args: []interface{}{1, 2, 3},
+ Args: []any{1, 2, 3},
Expected: 6,
},
{
Name: "Concat",
Fn: func(a, b, c string) string { return a + b + c },
- Args: []interface{}{"a", "b", "c"},
+ Args: []any{"a", "b", "c"},
Expected: "abc",
},
{
Name: "Length (slice type)",
Fn: func(list []int) (int, error) { return len(list), nil },
- Args: []interface{}{[]int{1, 2, 3}},
+ Args: []any{[]int{1, 2, 3}},
Expected: 3,
},
{
Name: "Emitter",
Fn: func(emit func(int)) { emit(1) },
- Args: []interface{}{func(int) {}},
+ Args: []any{func(int) {}},
},
{
Name: "Side input",
@@ -434,21 +434,21 @@ func BenchmarkInvoke(b *testing.B) {
}
return ret
},
- Args: []interface{}{1, func(out *int) bool { *out = 2; return true }},
+ Args: []any{1, func(out *int) bool { *out = 2; return true }},
Expected: 2,
},
{
Name: "Sum as Main",
Fn: func(a, b, c int) int { return a + b + c },
Opt: &MainInput{Key: FullValue{Elm: 1}},
- Args: []interface{}{2, 3},
+ Args: []any{2, 3},
Expected: 6,
},
{
Name: "Sum as Main KV",
Fn: func(a, b, c int) int { return a + b + c },
Opt: &MainInput{Key: FullValue{Elm: 1, Elm2: 2}},
- Args: []interface{}{3},
+ Args: []any{3},
Expected: 6,
},
{
@@ -651,7 +651,7 @@ type callerFooRInt struct {
fn func(*Foo, int) int
}
-func funcMakerFooRInt(fn interface{}) reflectx.Func {
+func funcMakerFooRInt(fn any) reflectx.Func {
f := fn.(func(*Foo, int) int)
return &callerFooRInt{fn: f}
}
@@ -664,13 +664,13 @@ func (c *callerFooRInt) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *callerFooRInt) Call(args []interface{}) []interface{} {
+func (c *callerFooRInt) Call(args []any) []any {
a := c.fn(args[0].(*Foo), args[1].(int))
- return []interface{}{a}
+ return []any{a}
}
// To satisfy reflectx.Func2x1
-func (c *callerFooRInt) Call2x1(a1, a2 interface{}) interface{} {
+func (c *callerFooRInt) Call2x1(a1, a2 any) any {
return c.fn(a1.(*Foo), a2.(int))
}
@@ -679,7 +679,7 @@ type callerInt struct {
fn func(int) int
}
-func funcMakerInt(fn interface{}) reflectx.Func {
+func funcMakerInt(fn any) reflectx.Func {
f := fn.(func(int) int)
return &callerInt{fn: f}
}
@@ -692,12 +692,12 @@ func (c *callerInt) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *callerInt) Call(args []interface{}) []interface{} {
+func (c *callerInt) Call(args []any) []any {
a := c.fn(args[0].(int))
- return []interface{}{a}
+ return []any{a}
}
-func (c *callerInt) Call1x1(a0 interface{}) interface{} {
+func (c *callerInt) Call1x1(a0 any) any {
return c.fn(a0.(int))
}
@@ -726,7 +726,7 @@ func (c *callerInt) Call1x1(a0 interface{}) interface{} {
// Interface() method.
func BenchmarkMethodCalls(b *testing.B) {
f := &Foo{A: 3}
- var gi interface{}
+ var gi any
g := &Foo{A: 42}
gi = g
gV := reflect.ValueOf(g)
@@ -762,12 +762,12 @@ func BenchmarkMethodCalls(b *testing.B) {
// Parameters
var a int
- var ai interface{} = a
+ var ai any = a
aV := reflect.ValueOf(a)
rvSlice := []reflect.Value{aV}
grvSlice := []reflect.Value{gV, aV}
- efaceSlice := []interface{}{a}
- gEfaceSlice := []interface{}{g, a}
+ efaceSlice := []any{a}
+ gEfaceSlice := []any{g, a}
tests := []struct {
name string
@@ -785,11 +785,11 @@ func BenchmarkMethodCalls(b *testing.B) {
{"ReflectCallImplicit-NoWrap", func() { a = impRF.Call([]reflect.Value{aV})[0].Interface().(int) }},
{"ReflectCallImplicit-NoReallocSlice", func() { a = impRF.Call(rvSlice)[0].Interface().(int) }},
- {"ReflectXCallImplicit", func() { a = impRxF.Call([]interface{}{a})[0].(int) }},
+ {"ReflectXCallImplicit", func() { a = impRxF.Call([]any{a})[0].(int) }},
{"ReflectXCallImplicit-NoReallocSlice", func() { a = impRxF.Call(efaceSlice)[0].(int) }},
{"ReflectXCall1x1Implicit", func() { a = impRx1x1F.Call1x1(a).(int) }}, // Measures the default shimfunc overhead.
- {"ShimedCallImplicit", func() { a = impRShimF.Call([]interface{}{a})[0].(int) }}, // What we're currently using for invoking methods
+ {"ShimedCallImplicit", func() { a = impRShimF.Call([]any{a})[0].(int) }}, // What we're currently using for invoking methods
{"ShimedCallImplicit-NoReallocSlice", func() { a = impRShimF.Call(efaceSlice)[0].(int) }}, // Closer to what we're using now.
{"ShimedCall1x1Implicit", func() { a = impRShim1x1F.Call1x1(a).(int) }},
@@ -801,11 +801,11 @@ func BenchmarkMethodCalls(b *testing.B) {
{"ReflectCallExplicit-NoWrap", func() { a = expRF.Call([]reflect.Value{gV, aV})[0].Interface().(int) }},
{"ReflectCallExplicit-NoReallocSlice", func() { a = expRF.Call(grvSlice)[0].Interface().(int) }},
- {"ReflectXCallExplicit", func() { a = expRxF.Call([]interface{}{g, a})[0].(int) }},
+ {"ReflectXCallExplicit", func() { a = expRxF.Call([]any{g, a})[0].(int) }},
{"ReflectXCallExplicit-NoReallocSlice", func() { a = expRxF.Call(gEfaceSlice)[0].(int) }},
{"ReflectXCall2x1Explicit", func() { a = expRx2c1F.Call2x1(g, a).(int) }},
- {"ShimedCallExplicit", func() { a = expRShimF.Call([]interface{}{g, a})[0].(int) }},
+ {"ShimedCallExplicit", func() { a = expRShimF.Call([]any{g, a})[0].(int) }},
{"ShimedCallExplicit-NoReallocSlice", func() { a = expRShimF.Call(gEfaceSlice)[0].(int) }},
{"ShimedCall2x1Explicit", func() { a = expRShim2x1F.Call2x1(g, a).(int) }},
@@ -817,11 +817,11 @@ func BenchmarkMethodCalls(b *testing.B) {
{"ReflectCallClosured-NoWrap", func() { a = clsrRF.Call([]reflect.Value{aV})[0].Interface().(int) }},
{"ReflectCallClosured-NoReallocSlice", func() { a = clsrRF.Call(rvSlice)[0].Interface().(int) }},
- {"ReflectXCallClosured", func() { a = clsrRxF.Call([]interface{}{a})[0].(int) }},
+ {"ReflectXCallClosured", func() { a = clsrRxF.Call([]any{a})[0].(int) }},
{"ReflectXCallClosured-NoReallocSlice", func() { a = clsrRxF.Call(efaceSlice)[0].(int) }},
{"ReflectXCall1x1Closured", func() { a = clsrRx1x1F.Call1x1(a).(int) }}, // Measures the default shimfunc overhead.
- {"ShimedCallClosured", func() { a = clsrRShimF.Call([]interface{}{a})[0].(int) }}, // What we're currently using for invoking methods
+ {"ShimedCallClosured", func() { a = clsrRShimF.Call([]any{a})[0].(int) }}, // What we're currently using for invoking methods
{"ShimedCallClosured-NoReallocSlice", func() { a = clsrRShimF.Call(efaceSlice)[0].(int) }}, // Closer to what we're using now.
{"ShimedCall1x1Closured", func() { a = clsrRShim1x1F.Call1x1(a).(int) }},
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/fullvalue.go b/sdks/go/pkg/beam/core/runtime/exec/fullvalue.go
index acc94d8667f..16bc228944e 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/fullvalue.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/fullvalue.go
@@ -35,8 +35,8 @@ import (
// The consumer is responsible for converting the values to the correct type.
// To represent a nested KV with FullValues, assign a *FullValue to Elm/Elm2.
type FullValue struct {
- Elm interface{} // Element or KV key.
- Elm2 interface{} // KV value, if not invalid
+ Elm any // Element or KV key.
+ Elm2 any // KV value, if not invalid
Timestamp typex.EventTime
Windows []typex.Window
@@ -99,14 +99,14 @@ func (s *FixedStream) Read() (*FullValue, error) {
// Convert converts type of the runtime value to the desired one. It is needed
// to drop the universal type and convert Aggregate types.
-func Convert(v interface{}, to reflect.Type) interface{} {
+func Convert(v any, to reflect.Type) any {
from := reflect.TypeOf(v)
return ConvertFn(from, to)(v)
}
// ConvertFn returns a function that converts type of the runtime value to the desired one. It is needed
// to drop the universal type and convert Aggregate types.
-func ConvertFn(from, to reflect.Type) func(interface{}) interface{} {
+func ConvertFn(from, to reflect.Type) func(any) any {
switch {
case from == to:
return identity
@@ -118,7 +118,7 @@ func ConvertFn(from, to reflect.Type) func(interface{}) interface{} {
fromE := from.Elem()
toE := to.Elem()
cvtFn := ConvertFn(fromE, toE)
- return func(v interface{}) interface{} {
+ return func(v any) any {
// Convert []A to []B.
value := reflect.ValueOf(v)
@@ -131,7 +131,7 @@ func ConvertFn(from, to reflect.Type) func(interface{}) interface{} {
case typex.IsList(from) && typex.IsUniversal(from.Elem()) && typex.IsUniversal(to):
fromE := from.Elem()
- return func(v interface{}) interface{} {
+ return func(v any) any {
// Convert []typex.T to the underlying type []T.
value := reflect.ValueOf(v)
@@ -162,12 +162,12 @@ func ConvertFn(from, to reflect.Type) func(interface{}) interface{} {
}
// identity is the identity function.
-func identity(v interface{}) interface{} {
+func identity(v any) any {
return v
}
// universal drops the universal type and re-interfaces it to the actual one.
-func universal(v interface{}) interface{} {
+func universal(v any) any {
return reflectx.UnderlyingType(reflect.ValueOf(v)).Interface()
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/fullvalue_test.go b/sdks/go/pkg/beam/core/runtime/exec/fullvalue_test.go
index 93c7038f6ea..d1482d59d16 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/fullvalue_test.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/fullvalue_test.go
@@ -27,7 +27,7 @@ import (
"github.com/apache/beam/sdks/v2/go/pkg/beam/core/util/reflectx"
)
-func makeInput(vs ...interface{}) []MainInput {
+func makeInput(vs ...any) []MainInput {
var ret []MainInput
for _, v := range makeValues(vs...) {
ret = append(ret, MainInput{Key: v})
@@ -35,7 +35,7 @@ func makeInput(vs ...interface{}) []MainInput {
return ret
}
-func makeValues(vs ...interface{}) []FullValue {
+func makeValues(vs ...any) []FullValue {
var ret []FullValue
for _, v := range vs {
ret = append(ret, FullValue{
@@ -47,7 +47,7 @@ func makeValues(vs ...interface{}) []FullValue {
return ret
}
-func makeWindowedInput(ws []typex.Window, vs ...interface{}) []MainInput {
+func makeWindowedInput(ws []typex.Window, vs ...any) []MainInput {
var ret []MainInput
for _, v := range makeWindowedValues(ws, vs...) {
ret = append(ret, MainInput{Key: v})
@@ -55,7 +55,7 @@ func makeWindowedInput(ws []typex.Window, vs ...interface{}) []MainInput {
return ret
}
-func makeWindowedValues(ws []typex.Window, vs ...interface{}) []FullValue {
+func makeWindowedValues(ws []typex.Window, vs ...any) []FullValue {
var ret []FullValue
for _, v := range vs {
ret = append(ret, FullValue{
@@ -67,7 +67,7 @@ func makeWindowedValues(ws []typex.Window, vs ...interface{}) []FullValue {
return ret
}
-func makeValuesNoWindowOrTime(vs ...interface{}) []FullValue {
+func makeValuesNoWindowOrTime(vs ...any) []FullValue {
var ret []FullValue
for _, v := range vs {
ret = append(ret, FullValue{
@@ -78,7 +78,7 @@ func makeValuesNoWindowOrTime(vs ...interface{}) []FullValue {
}
// makeKVValues returns a list of KV<K,V> inputs as a list of main inputs.
-func makeKVInput(key interface{}, vs ...interface{}) []MainInput {
+func makeKVInput(key any, vs ...any) []MainInput {
var ret []MainInput
for _, v := range makeKVValues(key, vs...) {
ret = append(ret, MainInput{Key: v})
@@ -87,7 +87,7 @@ func makeKVInput(key interface{}, vs ...interface{}) []MainInput {
}
// makeKVValues returns a list of KV<K,V> inputs.
-func makeKVValues(key interface{}, vs ...interface{}) []FullValue {
+func makeKVValues(key any, vs ...any) []FullValue {
var ret []FullValue
for _, v := range vs {
k := FullValue{
@@ -103,7 +103,7 @@ func makeKVValues(key interface{}, vs ...interface{}) []FullValue {
// makeKeyedInput returns a CoGBK<K, V> where the list of values are a stream
// in a single main input.
-func makeKeyedInput(key interface{}, vs ...interface{}) []MainInput {
+func makeKeyedInput(key any, vs ...any) []MainInput {
k := FullValue{
Windows: window.SingleGlobalWindow,
Timestamp: mtime.ZeroTimestamp,
@@ -115,7 +115,7 @@ func makeKeyedInput(key interface{}, vs ...interface{}) []MainInput {
}}
}
-func makeKV(k, v interface{}) []FullValue {
+func makeKV(k, v any) []FullValue {
return []FullValue{{
Windows: window.SingleGlobalWindow,
Timestamp: mtime.ZeroTimestamp,
@@ -124,16 +124,16 @@ func makeKV(k, v interface{}) []FullValue {
}}
}
-func extractValues(vs ...FullValue) []interface{} {
- var ret []interface{}
+func extractValues(vs ...FullValue) []any {
+ var ret []any
for _, v := range vs {
ret = append(ret, v.Elm)
}
return ret
}
-func extractKeyedValues(vs ...FullValue) []interface{} {
- var ret []interface{}
+func extractKeyedValues(vs ...FullValue) []any {
+ var ret []any
for _, v := range vs {
ret = append(ret, v.Elm2)
}
@@ -189,7 +189,7 @@ func TestConvert(t *testing.T) {
tests := []struct {
name string
to reflect.Type
- v, want interface{}
+ v, want any
}{
{
name: "int_to_int",
@@ -270,7 +270,7 @@ func TestDecodeStream(t *testing.T) {
if got, want := len(vals), int(size); got != want {
t.Errorf("unable to ReadAll from decodeStream, got %v elements, want %v elements", got, want)
}
- var wants []interface{}
+ var wants []any
for i := int64(0); i < size; i++ {
wants = append(wants, i)
}
@@ -296,7 +296,7 @@ func TestDecodeStream(t *testing.T) {
if got, want := len(vals), int(shortSize); got != want {
t.Errorf("unable to ReadAll from decodeStream, got %v elements, want %v elements", got, want)
}
- var wants []interface{}
+ var wants []any
for i := int64(0); i < shortSize; i++ {
wants = append(wants, i)
}
@@ -355,7 +355,7 @@ func TestDecodeMultiChunkStream(t *testing.T) {
if got, want := len(vals), int(size); got != want {
t.Errorf("unable to ReadAll from decodeStream, got %v elements, want %v elements", got, want)
}
- var wants []interface{}
+ var wants []any
for i := int64(0); i < size; i++ {
wants = append(wants, i)
}
@@ -381,7 +381,7 @@ func TestDecodeMultiChunkStream(t *testing.T) {
if got, want := len(vals), int(shortSize); got != want {
t.Errorf("unable to ReadAll from decodeStream, got %v elements, want %v elements", got, want)
}
- var wants []interface{}
+ var wants []any
for i := int64(0); i < shortSize; i++ {
wants = append(wants, i)
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/hash.go b/sdks/go/pkg/beam/core/runtime/exec/hash.go
index 70fbfa0b0f9..353d203d4e4 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/hash.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/hash.go
@@ -31,7 +31,7 @@ import (
// Infrastructure for hashing values for lifted combines.
type elementHasher interface {
- Hash(element interface{}, w typex.Window) (uint64, error)
+ Hash(element any, w typex.Window) (uint64, error)
}
func makeElementHasher(c *coder.Coder, wc *coder.WindowCoder) elementHasher {
@@ -81,7 +81,7 @@ type bytesHasher struct {
we WindowEncoder
}
-func (h *bytesHasher) Hash(element interface{}, w typex.Window) (uint64, error) {
+func (h *bytesHasher) Hash(element any, w typex.Window) (uint64, error) {
h.hash.Reset()
h.hash.Write(element.([]byte))
h.we.EncodeSingle(w, h.hash)
@@ -93,7 +93,7 @@ type stringHasher struct {
we WindowEncoder
}
-func (h *stringHasher) Hash(element interface{}, w typex.Window) (uint64, error) {
+func (h *stringHasher) Hash(element any, w typex.Window) (uint64, error) {
h.hash.Reset()
s := element.(string)
var b [64]byte
@@ -127,7 +127,7 @@ func newNumberHasher(hash hash.Hash64, we WindowEncoder) *numberHasher {
}
}
-func (h *numberHasher) Hash(element interface{}, w typex.Window) (uint64, error) {
+func (h *numberHasher) Hash(element any, w typex.Window) (uint64, error) {
h.hash.Reset()
var val uint64
switch n := element.(type) {
@@ -171,7 +171,7 @@ type rowHasher struct {
fv FullValue
}
-func (h *rowHasher) Hash(element interface{}, w typex.Window) (uint64, error) {
+func (h *rowHasher) Hash(element any, w typex.Window) (uint64, error) {
h.hash.Reset()
h.fv.Elm = element
if err := h.coder.Encode(&h.fv, h.hash); err != nil {
@@ -189,7 +189,7 @@ type customEncodedHasher struct {
we WindowEncoder
}
-func (h *customEncodedHasher) Hash(element interface{}, w typex.Window) (uint64, error) {
+func (h *customEncodedHasher) Hash(element any, w typex.Window) (uint64, error) {
h.hash.Reset()
b, err := h.coder.Encode(h.t, element)
if err != nil {
diff --git a/sdks/go/pkg/beam/core/runtime/exec/hash_test.go b/sdks/go/pkg/beam/core/runtime/exec/hash_test.go
index 528dfd07baa..20fa46c5d37 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/hash_test.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/hash_test.go
@@ -36,7 +36,7 @@ func BenchmarkPrimitives(b *testing.B) {
wfn := window.NewGlobalWindows()
we := MakeWindowEncoder(wfn.Coder())
b.Run("int", func(b *testing.B) {
- test := interface{}(int(42424242))
+ test := any(int(42424242))
b.Run("native", func(b *testing.B) {
m := make(map[int]FullValue)
for i := 0; i < b.N; i++ {
@@ -55,7 +55,7 @@ func BenchmarkPrimitives(b *testing.B) {
hashbench(b, test, encoded, dedicated)
})
b.Run("float32", func(b *testing.B) {
- test := interface{}(float32(42424242.242424))
+ test := any(float32(42424242.242424))
b.Run("native", func(b *testing.B) {
m := make(map[float32]FullValue)
for i := 0; i < b.N; i++ {
@@ -75,7 +75,7 @@ func BenchmarkPrimitives(b *testing.B) {
})
b.Run("string", func(b *testing.B) {
- tests := []interface{}{
+ tests := []any{
"I am the very model of a modern major string.",
"this is 10",
strings.Repeat("100 chars!", 10), // 100
@@ -104,7 +104,7 @@ func BenchmarkPrimitives(b *testing.B) {
}
})
b.Run("struct", func(b *testing.B) {
- tests := []interface{}{
+ tests := []any{
struct {
A int
B string
@@ -124,15 +124,15 @@ func BenchmarkPrimitives(b *testing.B) {
type jsonEncoder struct{}
-func (*jsonEncoder) Encode(t reflect.Type, element interface{}) ([]byte, error) {
+func (*jsonEncoder) Encode(t reflect.Type, element any) ([]byte, error) {
return json.Marshal(element)
}
-func hashbench(b *testing.B, test interface{}, encoded, dedicated elementHasher) {
+func hashbench(b *testing.B, test any, encoded, dedicated elementHasher) {
var value FullValue
gw := window.SingleGlobalWindow[0]
b.Run("interface", func(b *testing.B) {
- m := make(map[interface{}]FullValue)
+ m := make(map[any]FullValue)
for i := 0; i < b.N; i++ {
k := test
value = m[k]
diff --git a/sdks/go/pkg/beam/core/runtime/exec/input.go b/sdks/go/pkg/beam/core/runtime/exec/input.go
index b673854769b..707fe964f01 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/input.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/input.go
@@ -38,7 +38,7 @@ type ReusableInput interface {
// Init initializes the value before use.
Init() error
// Value returns the side input value.
- Value() interface{}
+ Value() any
// Reset resets the value after use.
Reset() error
}
@@ -65,7 +65,7 @@ func IsInputRegistered(t reflect.Type) bool {
type reIterValue struct {
t reflect.Type
s ReStream
- fn interface{}
+ fn any
}
func makeReIter(t reflect.Type, s ReStream) ReusableInput {
@@ -82,7 +82,7 @@ func (v *reIterValue) Init() error {
return nil
}
-func (v *reIterValue) Value() interface{} {
+func (v *reIterValue) Value() any {
return v.fn
}
@@ -98,7 +98,7 @@ func (v *reIterValue) invoke(args []reflect.Value) []reflect.Value {
type iterValue struct {
s ReStream
- fn interface{}
+ fn any
types []reflect.Type
// cur is the "current" stream, if any.
@@ -136,7 +136,7 @@ func (v *iterValue) Init() error {
return nil
}
-func (v *iterValue) Value() interface{} {
+func (v *iterValue) Value() any {
return v.fn
}
@@ -181,14 +181,14 @@ func (v *iterValue) invoke(args []reflect.Value) []reflect.Value {
}
type fixedValue struct {
- val interface{}
+ val any
}
func (v *fixedValue) Init() error {
return nil
}
-func (v *fixedValue) Value() interface{} {
+func (v *fixedValue) Value() any {
return v.val
}
@@ -205,7 +205,7 @@ type multiMapValue struct {
reader StateReader
w typex.Window
// fn is the actual invoked function
- fn interface{}
+ fn any
}
func makeMultiMap(ctx context.Context, t reflect.Type, adapter SideInputAdapter, reader StateReader, w typex.Window) ReusableInput {
@@ -222,7 +222,7 @@ func (v *multiMapValue) Init() error {
return nil
}
-func (v *multiMapValue) Value() interface{} {
+func (v *multiMapValue) Value() any {
return v.fn
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/optimized/callers.go b/sdks/go/pkg/beam/core/runtime/exec/optimized/callers.go
index 3d361b18c15..d84d24baaf2 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/optimized/callers.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/optimized/callers.go
@@ -63,7 +63,7 @@ type nativeByteSliceMFunc struct {
fn func([]byte, []byte) []byte
}
-func funcMakerByteSliceM(fn interface{}) reflectx.Func {
+func funcMakerByteSliceM(fn any) reflectx.Func {
f := fn.(func([]byte, []byte) []byte)
return &nativeByteSliceMFunc{fn: f}
}
@@ -76,12 +76,12 @@ func (c *nativeByteSliceMFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeByteSliceMFunc) Call(args []interface{}) []interface{} {
+func (c *nativeByteSliceMFunc) Call(args []any) []any {
out := c.fn(args[0].([]byte), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeByteSliceMFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeByteSliceMFunc) Call2x1(a, b any) any {
return c.fn(a.([]byte), b.([]byte))
}
@@ -89,7 +89,7 @@ type nativeBoolMFunc struct {
fn func(bool, bool) bool
}
-func funcMakerBoolM(fn interface{}) reflectx.Func {
+func funcMakerBoolM(fn any) reflectx.Func {
f := fn.(func(bool, bool) bool)
return &nativeBoolMFunc{fn: f}
}
@@ -102,12 +102,12 @@ func (c *nativeBoolMFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeBoolMFunc) Call(args []interface{}) []interface{} {
+func (c *nativeBoolMFunc) Call(args []any) []any {
out := c.fn(args[0].(bool), args[1].(bool))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeBoolMFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeBoolMFunc) Call2x1(a, b any) any {
return c.fn(a.(bool), b.(bool))
}
@@ -115,7 +115,7 @@ type nativeStringMFunc struct {
fn func(string, string) string
}
-func funcMakerStringM(fn interface{}) reflectx.Func {
+func funcMakerStringM(fn any) reflectx.Func {
f := fn.(func(string, string) string)
return &nativeStringMFunc{fn: f}
}
@@ -128,12 +128,12 @@ func (c *nativeStringMFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeStringMFunc) Call(args []interface{}) []interface{} {
+func (c *nativeStringMFunc) Call(args []any) []any {
out := c.fn(args[0].(string), args[1].(string))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeStringMFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeStringMFunc) Call2x1(a, b any) any {
return c.fn(a.(string), b.(string))
}
@@ -141,7 +141,7 @@ type nativeIntMFunc struct {
fn func(int, int) int
}
-func funcMakerIntM(fn interface{}) reflectx.Func {
+func funcMakerIntM(fn any) reflectx.Func {
f := fn.(func(int, int) int)
return &nativeIntMFunc{fn: f}
}
@@ -154,12 +154,12 @@ func (c *nativeIntMFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeIntMFunc) Call(args []interface{}) []interface{} {
+func (c *nativeIntMFunc) Call(args []any) []any {
out := c.fn(args[0].(int), args[1].(int))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeIntMFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeIntMFunc) Call2x1(a, b any) any {
return c.fn(a.(int), b.(int))
}
@@ -167,7 +167,7 @@ type nativeInt8MFunc struct {
fn func(int8, int8) int8
}
-func funcMakerInt8M(fn interface{}) reflectx.Func {
+func funcMakerInt8M(fn any) reflectx.Func {
f := fn.(func(int8, int8) int8)
return &nativeInt8MFunc{fn: f}
}
@@ -180,12 +180,12 @@ func (c *nativeInt8MFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeInt8MFunc) Call(args []interface{}) []interface{} {
+func (c *nativeInt8MFunc) Call(args []any) []any {
out := c.fn(args[0].(int8), args[1].(int8))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeInt8MFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeInt8MFunc) Call2x1(a, b any) any {
return c.fn(a.(int8), b.(int8))
}
@@ -193,7 +193,7 @@ type nativeInt16MFunc struct {
fn func(int16, int16) int16
}
-func funcMakerInt16M(fn interface{}) reflectx.Func {
+func funcMakerInt16M(fn any) reflectx.Func {
f := fn.(func(int16, int16) int16)
return &nativeInt16MFunc{fn: f}
}
@@ -206,12 +206,12 @@ func (c *nativeInt16MFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeInt16MFunc) Call(args []interface{}) []interface{} {
+func (c *nativeInt16MFunc) Call(args []any) []any {
out := c.fn(args[0].(int16), args[1].(int16))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeInt16MFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeInt16MFunc) Call2x1(a, b any) any {
return c.fn(a.(int16), b.(int16))
}
@@ -219,7 +219,7 @@ type nativeInt32MFunc struct {
fn func(int32, int32) int32
}
-func funcMakerInt32M(fn interface{}) reflectx.Func {
+func funcMakerInt32M(fn any) reflectx.Func {
f := fn.(func(int32, int32) int32)
return &nativeInt32MFunc{fn: f}
}
@@ -232,12 +232,12 @@ func (c *nativeInt32MFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeInt32MFunc) Call(args []interface{}) []interface{} {
+func (c *nativeInt32MFunc) Call(args []any) []any {
out := c.fn(args[0].(int32), args[1].(int32))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeInt32MFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeInt32MFunc) Call2x1(a, b any) any {
return c.fn(a.(int32), b.(int32))
}
@@ -245,7 +245,7 @@ type nativeInt64MFunc struct {
fn func(int64, int64) int64
}
-func funcMakerInt64M(fn interface{}) reflectx.Func {
+func funcMakerInt64M(fn any) reflectx.Func {
f := fn.(func(int64, int64) int64)
return &nativeInt64MFunc{fn: f}
}
@@ -258,12 +258,12 @@ func (c *nativeInt64MFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeInt64MFunc) Call(args []interface{}) []interface{} {
+func (c *nativeInt64MFunc) Call(args []any) []any {
out := c.fn(args[0].(int64), args[1].(int64))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeInt64MFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeInt64MFunc) Call2x1(a, b any) any {
return c.fn(a.(int64), b.(int64))
}
@@ -271,7 +271,7 @@ type nativeUintMFunc struct {
fn func(uint, uint) uint
}
-func funcMakerUintM(fn interface{}) reflectx.Func {
+func funcMakerUintM(fn any) reflectx.Func {
f := fn.(func(uint, uint) uint)
return &nativeUintMFunc{fn: f}
}
@@ -284,12 +284,12 @@ func (c *nativeUintMFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeUintMFunc) Call(args []interface{}) []interface{} {
+func (c *nativeUintMFunc) Call(args []any) []any {
out := c.fn(args[0].(uint), args[1].(uint))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeUintMFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeUintMFunc) Call2x1(a, b any) any {
return c.fn(a.(uint), b.(uint))
}
@@ -297,7 +297,7 @@ type nativeUint8MFunc struct {
fn func(uint8, uint8) uint8
}
-func funcMakerUint8M(fn interface{}) reflectx.Func {
+func funcMakerUint8M(fn any) reflectx.Func {
f := fn.(func(uint8, uint8) uint8)
return &nativeUint8MFunc{fn: f}
}
@@ -310,12 +310,12 @@ func (c *nativeUint8MFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeUint8MFunc) Call(args []interface{}) []interface{} {
+func (c *nativeUint8MFunc) Call(args []any) []any {
out := c.fn(args[0].(uint8), args[1].(uint8))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeUint8MFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeUint8MFunc) Call2x1(a, b any) any {
return c.fn(a.(uint8), b.(uint8))
}
@@ -323,7 +323,7 @@ type nativeUint16MFunc struct {
fn func(uint16, uint16) uint16
}
-func funcMakerUint16M(fn interface{}) reflectx.Func {
+func funcMakerUint16M(fn any) reflectx.Func {
f := fn.(func(uint16, uint16) uint16)
return &nativeUint16MFunc{fn: f}
}
@@ -336,12 +336,12 @@ func (c *nativeUint16MFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeUint16MFunc) Call(args []interface{}) []interface{} {
+func (c *nativeUint16MFunc) Call(args []any) []any {
out := c.fn(args[0].(uint16), args[1].(uint16))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeUint16MFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeUint16MFunc) Call2x1(a, b any) any {
return c.fn(a.(uint16), b.(uint16))
}
@@ -349,7 +349,7 @@ type nativeUint32MFunc struct {
fn func(uint32, uint32) uint32
}
-func funcMakerUint32M(fn interface{}) reflectx.Func {
+func funcMakerUint32M(fn any) reflectx.Func {
f := fn.(func(uint32, uint32) uint32)
return &nativeUint32MFunc{fn: f}
}
@@ -362,12 +362,12 @@ func (c *nativeUint32MFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeUint32MFunc) Call(args []interface{}) []interface{} {
+func (c *nativeUint32MFunc) Call(args []any) []any {
out := c.fn(args[0].(uint32), args[1].(uint32))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeUint32MFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeUint32MFunc) Call2x1(a, b any) any {
return c.fn(a.(uint32), b.(uint32))
}
@@ -375,7 +375,7 @@ type nativeUint64MFunc struct {
fn func(uint64, uint64) uint64
}
-func funcMakerUint64M(fn interface{}) reflectx.Func {
+func funcMakerUint64M(fn any) reflectx.Func {
f := fn.(func(uint64, uint64) uint64)
return &nativeUint64MFunc{fn: f}
}
@@ -388,12 +388,12 @@ func (c *nativeUint64MFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeUint64MFunc) Call(args []interface{}) []interface{} {
+func (c *nativeUint64MFunc) Call(args []any) []any {
out := c.fn(args[0].(uint64), args[1].(uint64))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeUint64MFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeUint64MFunc) Call2x1(a, b any) any {
return c.fn(a.(uint64), b.(uint64))
}
@@ -401,7 +401,7 @@ type nativeFloat32MFunc struct {
fn func(float32, float32) float32
}
-func funcMakerFloat32M(fn interface{}) reflectx.Func {
+func funcMakerFloat32M(fn any) reflectx.Func {
f := fn.(func(float32, float32) float32)
return &nativeFloat32MFunc{fn: f}
}
@@ -414,12 +414,12 @@ func (c *nativeFloat32MFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeFloat32MFunc) Call(args []interface{}) []interface{} {
+func (c *nativeFloat32MFunc) Call(args []any) []any {
out := c.fn(args[0].(float32), args[1].(float32))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeFloat32MFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeFloat32MFunc) Call2x1(a, b any) any {
return c.fn(a.(float32), b.(float32))
}
@@ -427,7 +427,7 @@ type nativeFloat64MFunc struct {
fn func(float64, float64) float64
}
-func funcMakerFloat64M(fn interface{}) reflectx.Func {
+func funcMakerFloat64M(fn any) reflectx.Func {
f := fn.(func(float64, float64) float64)
return &nativeFloat64MFunc{fn: f}
}
@@ -440,12 +440,12 @@ func (c *nativeFloat64MFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeFloat64MFunc) Call(args []interface{}) []interface{} {
+func (c *nativeFloat64MFunc) Call(args []any) []any {
out := c.fn(args[0].(float64), args[1].(float64))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeFloat64MFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeFloat64MFunc) Call2x1(a, b any) any {
return c.fn(a.(float64), b.(float64))
}
@@ -453,7 +453,7 @@ type nativeTypex_TMFunc struct {
fn func(typex.T, typex.T) typex.T
}
-func funcMakerTypex_TM(fn interface{}) reflectx.Func {
+func funcMakerTypex_TM(fn any) reflectx.Func {
f := fn.(func(typex.T, typex.T) typex.T)
return &nativeTypex_TMFunc{fn: f}
}
@@ -466,12 +466,12 @@ func (c *nativeTypex_TMFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeTypex_TMFunc) Call(args []interface{}) []interface{} {
+func (c *nativeTypex_TMFunc) Call(args []any) []any {
out := c.fn(args[0].(typex.T), args[1].(typex.T))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeTypex_TMFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeTypex_TMFunc) Call2x1(a, b any) any {
return c.fn(a.(typex.T), b.(typex.T))
}
@@ -479,7 +479,7 @@ type nativeTypex_UMFunc struct {
fn func(typex.U, typex.U) typex.U
}
-func funcMakerTypex_UM(fn interface{}) reflectx.Func {
+func funcMakerTypex_UM(fn any) reflectx.Func {
f := fn.(func(typex.U, typex.U) typex.U)
return &nativeTypex_UMFunc{fn: f}
}
@@ -492,12 +492,12 @@ func (c *nativeTypex_UMFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeTypex_UMFunc) Call(args []interface{}) []interface{} {
+func (c *nativeTypex_UMFunc) Call(args []any) []any {
out := c.fn(args[0].(typex.U), args[1].(typex.U))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeTypex_UMFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeTypex_UMFunc) Call2x1(a, b any) any {
return c.fn(a.(typex.U), b.(typex.U))
}
@@ -505,7 +505,7 @@ type nativeTypex_VMFunc struct {
fn func(typex.V, typex.V) typex.V
}
-func funcMakerTypex_VM(fn interface{}) reflectx.Func {
+func funcMakerTypex_VM(fn any) reflectx.Func {
f := fn.(func(typex.V, typex.V) typex.V)
return &nativeTypex_VMFunc{fn: f}
}
@@ -518,12 +518,12 @@ func (c *nativeTypex_VMFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeTypex_VMFunc) Call(args []interface{}) []interface{} {
+func (c *nativeTypex_VMFunc) Call(args []any) []any {
out := c.fn(args[0].(typex.V), args[1].(typex.V))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeTypex_VMFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeTypex_VMFunc) Call2x1(a, b any) any {
return c.fn(a.(typex.V), b.(typex.V))
}
@@ -531,7 +531,7 @@ type nativeTypex_WMFunc struct {
fn func(typex.W, typex.W) typex.W
}
-func funcMakerTypex_WM(fn interface{}) reflectx.Func {
+func funcMakerTypex_WM(fn any) reflectx.Func {
f := fn.(func(typex.W, typex.W) typex.W)
return &nativeTypex_WMFunc{fn: f}
}
@@ -544,12 +544,12 @@ func (c *nativeTypex_WMFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeTypex_WMFunc) Call(args []interface{}) []interface{} {
+func (c *nativeTypex_WMFunc) Call(args []any) []any {
out := c.fn(args[0].(typex.W), args[1].(typex.W))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeTypex_WMFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeTypex_WMFunc) Call2x1(a, b any) any {
return c.fn(a.(typex.W), b.(typex.W))
}
@@ -557,7 +557,7 @@ type nativeTypex_XMFunc struct {
fn func(typex.X, typex.X) typex.X
}
-func funcMakerTypex_XM(fn interface{}) reflectx.Func {
+func funcMakerTypex_XM(fn any) reflectx.Func {
f := fn.(func(typex.X, typex.X) typex.X)
return &nativeTypex_XMFunc{fn: f}
}
@@ -570,12 +570,12 @@ func (c *nativeTypex_XMFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeTypex_XMFunc) Call(args []interface{}) []interface{} {
+func (c *nativeTypex_XMFunc) Call(args []any) []any {
out := c.fn(args[0].(typex.X), args[1].(typex.X))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeTypex_XMFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeTypex_XMFunc) Call2x1(a, b any) any {
return c.fn(a.(typex.X), b.(typex.X))
}
@@ -583,7 +583,7 @@ type nativeTypex_YMFunc struct {
fn func(typex.Y, typex.Y) typex.Y
}
-func funcMakerTypex_YM(fn interface{}) reflectx.Func {
+func funcMakerTypex_YM(fn any) reflectx.Func {
f := fn.(func(typex.Y, typex.Y) typex.Y)
return &nativeTypex_YMFunc{fn: f}
}
@@ -596,12 +596,12 @@ func (c *nativeTypex_YMFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeTypex_YMFunc) Call(args []interface{}) []interface{} {
+func (c *nativeTypex_YMFunc) Call(args []any) []any {
out := c.fn(args[0].(typex.Y), args[1].(typex.Y))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeTypex_YMFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeTypex_YMFunc) Call2x1(a, b any) any {
return c.fn(a.(typex.Y), b.(typex.Y))
}
@@ -609,7 +609,7 @@ type nativeTypex_ZMFunc struct {
fn func(typex.Z, typex.Z) typex.Z
}
-func funcMakerTypex_ZM(fn interface{}) reflectx.Func {
+func funcMakerTypex_ZM(fn any) reflectx.Func {
f := fn.(func(typex.Z, typex.Z) typex.Z)
return &nativeTypex_ZMFunc{fn: f}
}
@@ -622,11 +622,11 @@ func (c *nativeTypex_ZMFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *nativeTypex_ZMFunc) Call(args []interface{}) []interface{} {
+func (c *nativeTypex_ZMFunc) Call(args []any) []any {
out := c.fn(args[0].(typex.Z), args[1].(typex.Z))
- return []interface{}{out}
+ return []any{out}
}
-func (c *nativeTypex_ZMFunc) Call2x1(a, b interface{}) interface{} {
+func (c *nativeTypex_ZMFunc) Call2x1(a, b any) any {
return c.fn(a.(typex.Z), b.(typex.Z))
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/optimized/callers.tmpl b/sdks/go/pkg/beam/core/runtime/exec/optimized/callers.tmpl
index ed4990e5bc2..c2efaba17aa 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/optimized/callers.tmpl
+++ b/sdks/go/pkg/beam/core/runtime/exec/optimized/callers.tmpl
@@ -45,7 +45,7 @@ type native{{$x.Name}}MFunc struct {
fn func ({{$x.Type}}, {{$x.Type}}){{$x.Type}}
}
-func funcMaker{{$x.Name}}M(fn interface{}) reflectx.Func {
+func funcMaker{{$x.Name}}M(fn any) reflectx.Func {
f := fn.(func ({{$x.Type}}, {{$x.Type}}){{$x.Type}})
return &native{{$x.Name}}MFunc{fn: f}
}
@@ -58,12 +58,12 @@ func (c *native{{$x.Name}}MFunc) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *native{{$x.Name}}MFunc) Call(args []interface{}) []interface{} {
+func (c *native{{$x.Name}}MFunc) Call(args []any) []any {
out := c.fn(args[0].({{$x.Type}}), args[1].({{$x.Type}}))
- return []interface{}{out}
+ return []any{out}
}
-func (c *native{{$x.Name}}MFunc) Call2x1(a, b interface{}) interface{} {
+func (c *native{{$x.Name}}MFunc) Call2x1(a, b any) any {
return c.fn(a.({{$x.Type}}), b.({{$x.Type}}))
}
{{end}}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/optimized/decoders.go b/sdks/go/pkg/beam/core/runtime/exec/optimized/decoders.go
index d44c9ea861d..9a41070ba44 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/optimized/decoders.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/optimized/decoders.go
@@ -122,7 +122,7 @@ type decoderByteSlice struct {
fn func([]byte) []byte
}
-func decoderMakerByteSlice(fn interface{}) reflectx.Func {
+func decoderMakerByteSlice(fn any) reflectx.Func {
f := fn.(func([]byte) []byte)
return &decoderByteSlice{fn: f}
}
@@ -135,12 +135,12 @@ func (c *decoderByteSlice) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderByteSlice) Call(args []interface{}) []interface{} {
+func (c *decoderByteSlice) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderByteSlice) Call1x1(v interface{}) interface{} {
+func (c *decoderByteSlice) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -148,7 +148,7 @@ type decoderByteSliceE struct {
fn func([]byte) ([]byte, error)
}
-func decoderMakerByteSliceE(fn interface{}) reflectx.Func {
+func decoderMakerByteSliceE(fn any) reflectx.Func {
f := fn.(func([]byte) ([]byte, error))
return &decoderByteSliceE{fn: f}
}
@@ -161,12 +161,12 @@ func (c *decoderByteSliceE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderByteSliceE) Call(args []interface{}) []interface{} {
+func (c *decoderByteSliceE) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderByteSliceE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderByteSliceE) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -174,7 +174,7 @@ type decoderTByteSlice struct {
fn func(reflect.Type, []byte) []byte
}
-func decoderMakerTByteSlice(fn interface{}) reflectx.Func {
+func decoderMakerTByteSlice(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) []byte)
return &decoderTByteSlice{fn: f}
}
@@ -187,12 +187,12 @@ func (c *decoderTByteSlice) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTByteSlice) Call(args []interface{}) []interface{} {
+func (c *decoderTByteSlice) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTByteSlice) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTByteSlice) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -200,7 +200,7 @@ type decoderTByteSliceE struct {
fn func(reflect.Type, []byte) ([]byte, error)
}
-func decoderMakerTByteSliceE(fn interface{}) reflectx.Func {
+func decoderMakerTByteSliceE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) ([]byte, error))
return &decoderTByteSliceE{fn: f}
}
@@ -213,12 +213,12 @@ func (c *decoderTByteSliceE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTByteSliceE) Call(args []interface{}) []interface{} {
+func (c *decoderTByteSliceE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTByteSliceE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTByteSliceE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -226,7 +226,7 @@ type decoderBool struct {
fn func([]byte) bool
}
-func decoderMakerBool(fn interface{}) reflectx.Func {
+func decoderMakerBool(fn any) reflectx.Func {
f := fn.(func([]byte) bool)
return &decoderBool{fn: f}
}
@@ -239,12 +239,12 @@ func (c *decoderBool) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderBool) Call(args []interface{}) []interface{} {
+func (c *decoderBool) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderBool) Call1x1(v interface{}) interface{} {
+func (c *decoderBool) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -252,7 +252,7 @@ type decoderBoolE struct {
fn func([]byte) (bool, error)
}
-func decoderMakerBoolE(fn interface{}) reflectx.Func {
+func decoderMakerBoolE(fn any) reflectx.Func {
f := fn.(func([]byte) (bool, error))
return &decoderBoolE{fn: f}
}
@@ -265,12 +265,12 @@ func (c *decoderBoolE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderBoolE) Call(args []interface{}) []interface{} {
+func (c *decoderBoolE) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderBoolE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderBoolE) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -278,7 +278,7 @@ type decoderTBool struct {
fn func(reflect.Type, []byte) bool
}
-func decoderMakerTBool(fn interface{}) reflectx.Func {
+func decoderMakerTBool(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) bool)
return &decoderTBool{fn: f}
}
@@ -291,12 +291,12 @@ func (c *decoderTBool) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTBool) Call(args []interface{}) []interface{} {
+func (c *decoderTBool) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTBool) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTBool) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -304,7 +304,7 @@ type decoderTBoolE struct {
fn func(reflect.Type, []byte) (bool, error)
}
-func decoderMakerTBoolE(fn interface{}) reflectx.Func {
+func decoderMakerTBoolE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (bool, error))
return &decoderTBoolE{fn: f}
}
@@ -317,12 +317,12 @@ func (c *decoderTBoolE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTBoolE) Call(args []interface{}) []interface{} {
+func (c *decoderTBoolE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTBoolE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTBoolE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -330,7 +330,7 @@ type decoderString struct {
fn func([]byte) string
}
-func decoderMakerString(fn interface{}) reflectx.Func {
+func decoderMakerString(fn any) reflectx.Func {
f := fn.(func([]byte) string)
return &decoderString{fn: f}
}
@@ -343,12 +343,12 @@ func (c *decoderString) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderString) Call(args []interface{}) []interface{} {
+func (c *decoderString) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderString) Call1x1(v interface{}) interface{} {
+func (c *decoderString) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -356,7 +356,7 @@ type decoderStringE struct {
fn func([]byte) (string, error)
}
-func decoderMakerStringE(fn interface{}) reflectx.Func {
+func decoderMakerStringE(fn any) reflectx.Func {
f := fn.(func([]byte) (string, error))
return &decoderStringE{fn: f}
}
@@ -369,12 +369,12 @@ func (c *decoderStringE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderStringE) Call(args []interface{}) []interface{} {
+func (c *decoderStringE) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderStringE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderStringE) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -382,7 +382,7 @@ type decoderTString struct {
fn func(reflect.Type, []byte) string
}
-func decoderMakerTString(fn interface{}) reflectx.Func {
+func decoderMakerTString(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) string)
return &decoderTString{fn: f}
}
@@ -395,12 +395,12 @@ func (c *decoderTString) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTString) Call(args []interface{}) []interface{} {
+func (c *decoderTString) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTString) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTString) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -408,7 +408,7 @@ type decoderTStringE struct {
fn func(reflect.Type, []byte) (string, error)
}
-func decoderMakerTStringE(fn interface{}) reflectx.Func {
+func decoderMakerTStringE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (string, error))
return &decoderTStringE{fn: f}
}
@@ -421,12 +421,12 @@ func (c *decoderTStringE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTStringE) Call(args []interface{}) []interface{} {
+func (c *decoderTStringE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTStringE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTStringE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -434,7 +434,7 @@ type decoderInt struct {
fn func([]byte) int
}
-func decoderMakerInt(fn interface{}) reflectx.Func {
+func decoderMakerInt(fn any) reflectx.Func {
f := fn.(func([]byte) int)
return &decoderInt{fn: f}
}
@@ -447,12 +447,12 @@ func (c *decoderInt) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderInt) Call(args []interface{}) []interface{} {
+func (c *decoderInt) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderInt) Call1x1(v interface{}) interface{} {
+func (c *decoderInt) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -460,7 +460,7 @@ type decoderIntE struct {
fn func([]byte) (int, error)
}
-func decoderMakerIntE(fn interface{}) reflectx.Func {
+func decoderMakerIntE(fn any) reflectx.Func {
f := fn.(func([]byte) (int, error))
return &decoderIntE{fn: f}
}
@@ -473,12 +473,12 @@ func (c *decoderIntE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderIntE) Call(args []interface{}) []interface{} {
+func (c *decoderIntE) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderIntE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderIntE) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -486,7 +486,7 @@ type decoderTInt struct {
fn func(reflect.Type, []byte) int
}
-func decoderMakerTInt(fn interface{}) reflectx.Func {
+func decoderMakerTInt(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) int)
return &decoderTInt{fn: f}
}
@@ -499,12 +499,12 @@ func (c *decoderTInt) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTInt) Call(args []interface{}) []interface{} {
+func (c *decoderTInt) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTInt) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTInt) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -512,7 +512,7 @@ type decoderTIntE struct {
fn func(reflect.Type, []byte) (int, error)
}
-func decoderMakerTIntE(fn interface{}) reflectx.Func {
+func decoderMakerTIntE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (int, error))
return &decoderTIntE{fn: f}
}
@@ -525,12 +525,12 @@ func (c *decoderTIntE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTIntE) Call(args []interface{}) []interface{} {
+func (c *decoderTIntE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTIntE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTIntE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -538,7 +538,7 @@ type decoderInt8 struct {
fn func([]byte) int8
}
-func decoderMakerInt8(fn interface{}) reflectx.Func {
+func decoderMakerInt8(fn any) reflectx.Func {
f := fn.(func([]byte) int8)
return &decoderInt8{fn: f}
}
@@ -551,12 +551,12 @@ func (c *decoderInt8) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderInt8) Call(args []interface{}) []interface{} {
+func (c *decoderInt8) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderInt8) Call1x1(v interface{}) interface{} {
+func (c *decoderInt8) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -564,7 +564,7 @@ type decoderInt8E struct {
fn func([]byte) (int8, error)
}
-func decoderMakerInt8E(fn interface{}) reflectx.Func {
+func decoderMakerInt8E(fn any) reflectx.Func {
f := fn.(func([]byte) (int8, error))
return &decoderInt8E{fn: f}
}
@@ -577,12 +577,12 @@ func (c *decoderInt8E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderInt8E) Call(args []interface{}) []interface{} {
+func (c *decoderInt8E) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderInt8E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderInt8E) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -590,7 +590,7 @@ type decoderTInt8 struct {
fn func(reflect.Type, []byte) int8
}
-func decoderMakerTInt8(fn interface{}) reflectx.Func {
+func decoderMakerTInt8(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) int8)
return &decoderTInt8{fn: f}
}
@@ -603,12 +603,12 @@ func (c *decoderTInt8) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTInt8) Call(args []interface{}) []interface{} {
+func (c *decoderTInt8) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTInt8) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTInt8) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -616,7 +616,7 @@ type decoderTInt8E struct {
fn func(reflect.Type, []byte) (int8, error)
}
-func decoderMakerTInt8E(fn interface{}) reflectx.Func {
+func decoderMakerTInt8E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (int8, error))
return &decoderTInt8E{fn: f}
}
@@ -629,12 +629,12 @@ func (c *decoderTInt8E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTInt8E) Call(args []interface{}) []interface{} {
+func (c *decoderTInt8E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTInt8E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTInt8E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -642,7 +642,7 @@ type decoderInt16 struct {
fn func([]byte) int16
}
-func decoderMakerInt16(fn interface{}) reflectx.Func {
+func decoderMakerInt16(fn any) reflectx.Func {
f := fn.(func([]byte) int16)
return &decoderInt16{fn: f}
}
@@ -655,12 +655,12 @@ func (c *decoderInt16) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderInt16) Call(args []interface{}) []interface{} {
+func (c *decoderInt16) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderInt16) Call1x1(v interface{}) interface{} {
+func (c *decoderInt16) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -668,7 +668,7 @@ type decoderInt16E struct {
fn func([]byte) (int16, error)
}
-func decoderMakerInt16E(fn interface{}) reflectx.Func {
+func decoderMakerInt16E(fn any) reflectx.Func {
f := fn.(func([]byte) (int16, error))
return &decoderInt16E{fn: f}
}
@@ -681,12 +681,12 @@ func (c *decoderInt16E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderInt16E) Call(args []interface{}) []interface{} {
+func (c *decoderInt16E) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderInt16E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderInt16E) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -694,7 +694,7 @@ type decoderTInt16 struct {
fn func(reflect.Type, []byte) int16
}
-func decoderMakerTInt16(fn interface{}) reflectx.Func {
+func decoderMakerTInt16(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) int16)
return &decoderTInt16{fn: f}
}
@@ -707,12 +707,12 @@ func (c *decoderTInt16) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTInt16) Call(args []interface{}) []interface{} {
+func (c *decoderTInt16) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTInt16) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTInt16) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -720,7 +720,7 @@ type decoderTInt16E struct {
fn func(reflect.Type, []byte) (int16, error)
}
-func decoderMakerTInt16E(fn interface{}) reflectx.Func {
+func decoderMakerTInt16E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (int16, error))
return &decoderTInt16E{fn: f}
}
@@ -733,12 +733,12 @@ func (c *decoderTInt16E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTInt16E) Call(args []interface{}) []interface{} {
+func (c *decoderTInt16E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTInt16E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTInt16E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -746,7 +746,7 @@ type decoderInt32 struct {
fn func([]byte) int32
}
-func decoderMakerInt32(fn interface{}) reflectx.Func {
+func decoderMakerInt32(fn any) reflectx.Func {
f := fn.(func([]byte) int32)
return &decoderInt32{fn: f}
}
@@ -759,12 +759,12 @@ func (c *decoderInt32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderInt32) Call(args []interface{}) []interface{} {
+func (c *decoderInt32) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderInt32) Call1x1(v interface{}) interface{} {
+func (c *decoderInt32) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -772,7 +772,7 @@ type decoderInt32E struct {
fn func([]byte) (int32, error)
}
-func decoderMakerInt32E(fn interface{}) reflectx.Func {
+func decoderMakerInt32E(fn any) reflectx.Func {
f := fn.(func([]byte) (int32, error))
return &decoderInt32E{fn: f}
}
@@ -785,12 +785,12 @@ func (c *decoderInt32E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderInt32E) Call(args []interface{}) []interface{} {
+func (c *decoderInt32E) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderInt32E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderInt32E) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -798,7 +798,7 @@ type decoderTInt32 struct {
fn func(reflect.Type, []byte) int32
}
-func decoderMakerTInt32(fn interface{}) reflectx.Func {
+func decoderMakerTInt32(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) int32)
return &decoderTInt32{fn: f}
}
@@ -811,12 +811,12 @@ func (c *decoderTInt32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTInt32) Call(args []interface{}) []interface{} {
+func (c *decoderTInt32) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTInt32) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTInt32) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -824,7 +824,7 @@ type decoderTInt32E struct {
fn func(reflect.Type, []byte) (int32, error)
}
-func decoderMakerTInt32E(fn interface{}) reflectx.Func {
+func decoderMakerTInt32E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (int32, error))
return &decoderTInt32E{fn: f}
}
@@ -837,12 +837,12 @@ func (c *decoderTInt32E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTInt32E) Call(args []interface{}) []interface{} {
+func (c *decoderTInt32E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTInt32E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTInt32E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -850,7 +850,7 @@ type decoderInt64 struct {
fn func([]byte) int64
}
-func decoderMakerInt64(fn interface{}) reflectx.Func {
+func decoderMakerInt64(fn any) reflectx.Func {
f := fn.(func([]byte) int64)
return &decoderInt64{fn: f}
}
@@ -863,12 +863,12 @@ func (c *decoderInt64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderInt64) Call(args []interface{}) []interface{} {
+func (c *decoderInt64) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderInt64) Call1x1(v interface{}) interface{} {
+func (c *decoderInt64) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -876,7 +876,7 @@ type decoderInt64E struct {
fn func([]byte) (int64, error)
}
-func decoderMakerInt64E(fn interface{}) reflectx.Func {
+func decoderMakerInt64E(fn any) reflectx.Func {
f := fn.(func([]byte) (int64, error))
return &decoderInt64E{fn: f}
}
@@ -889,12 +889,12 @@ func (c *decoderInt64E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderInt64E) Call(args []interface{}) []interface{} {
+func (c *decoderInt64E) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderInt64E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderInt64E) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -902,7 +902,7 @@ type decoderTInt64 struct {
fn func(reflect.Type, []byte) int64
}
-func decoderMakerTInt64(fn interface{}) reflectx.Func {
+func decoderMakerTInt64(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) int64)
return &decoderTInt64{fn: f}
}
@@ -915,12 +915,12 @@ func (c *decoderTInt64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTInt64) Call(args []interface{}) []interface{} {
+func (c *decoderTInt64) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTInt64) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTInt64) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -928,7 +928,7 @@ type decoderTInt64E struct {
fn func(reflect.Type, []byte) (int64, error)
}
-func decoderMakerTInt64E(fn interface{}) reflectx.Func {
+func decoderMakerTInt64E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (int64, error))
return &decoderTInt64E{fn: f}
}
@@ -941,12 +941,12 @@ func (c *decoderTInt64E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTInt64E) Call(args []interface{}) []interface{} {
+func (c *decoderTInt64E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTInt64E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTInt64E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -954,7 +954,7 @@ type decoderUint struct {
fn func([]byte) uint
}
-func decoderMakerUint(fn interface{}) reflectx.Func {
+func decoderMakerUint(fn any) reflectx.Func {
f := fn.(func([]byte) uint)
return &decoderUint{fn: f}
}
@@ -967,12 +967,12 @@ func (c *decoderUint) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderUint) Call(args []interface{}) []interface{} {
+func (c *decoderUint) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderUint) Call1x1(v interface{}) interface{} {
+func (c *decoderUint) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -980,7 +980,7 @@ type decoderUintE struct {
fn func([]byte) (uint, error)
}
-func decoderMakerUintE(fn interface{}) reflectx.Func {
+func decoderMakerUintE(fn any) reflectx.Func {
f := fn.(func([]byte) (uint, error))
return &decoderUintE{fn: f}
}
@@ -993,12 +993,12 @@ func (c *decoderUintE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderUintE) Call(args []interface{}) []interface{} {
+func (c *decoderUintE) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderUintE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderUintE) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -1006,7 +1006,7 @@ type decoderTUint struct {
fn func(reflect.Type, []byte) uint
}
-func decoderMakerTUint(fn interface{}) reflectx.Func {
+func decoderMakerTUint(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) uint)
return &decoderTUint{fn: f}
}
@@ -1019,12 +1019,12 @@ func (c *decoderTUint) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTUint) Call(args []interface{}) []interface{} {
+func (c *decoderTUint) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTUint) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTUint) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1032,7 +1032,7 @@ type decoderTUintE struct {
fn func(reflect.Type, []byte) (uint, error)
}
-func decoderMakerTUintE(fn interface{}) reflectx.Func {
+func decoderMakerTUintE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (uint, error))
return &decoderTUintE{fn: f}
}
@@ -1045,12 +1045,12 @@ func (c *decoderTUintE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTUintE) Call(args []interface{}) []interface{} {
+func (c *decoderTUintE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTUintE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTUintE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1058,7 +1058,7 @@ type decoderUint8 struct {
fn func([]byte) uint8
}
-func decoderMakerUint8(fn interface{}) reflectx.Func {
+func decoderMakerUint8(fn any) reflectx.Func {
f := fn.(func([]byte) uint8)
return &decoderUint8{fn: f}
}
@@ -1071,12 +1071,12 @@ func (c *decoderUint8) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderUint8) Call(args []interface{}) []interface{} {
+func (c *decoderUint8) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderUint8) Call1x1(v interface{}) interface{} {
+func (c *decoderUint8) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -1084,7 +1084,7 @@ type decoderUint8E struct {
fn func([]byte) (uint8, error)
}
-func decoderMakerUint8E(fn interface{}) reflectx.Func {
+func decoderMakerUint8E(fn any) reflectx.Func {
f := fn.(func([]byte) (uint8, error))
return &decoderUint8E{fn: f}
}
@@ -1097,12 +1097,12 @@ func (c *decoderUint8E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderUint8E) Call(args []interface{}) []interface{} {
+func (c *decoderUint8E) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderUint8E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderUint8E) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -1110,7 +1110,7 @@ type decoderTUint8 struct {
fn func(reflect.Type, []byte) uint8
}
-func decoderMakerTUint8(fn interface{}) reflectx.Func {
+func decoderMakerTUint8(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) uint8)
return &decoderTUint8{fn: f}
}
@@ -1123,12 +1123,12 @@ func (c *decoderTUint8) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTUint8) Call(args []interface{}) []interface{} {
+func (c *decoderTUint8) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTUint8) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTUint8) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1136,7 +1136,7 @@ type decoderTUint8E struct {
fn func(reflect.Type, []byte) (uint8, error)
}
-func decoderMakerTUint8E(fn interface{}) reflectx.Func {
+func decoderMakerTUint8E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (uint8, error))
return &decoderTUint8E{fn: f}
}
@@ -1149,12 +1149,12 @@ func (c *decoderTUint8E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTUint8E) Call(args []interface{}) []interface{} {
+func (c *decoderTUint8E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTUint8E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTUint8E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1162,7 +1162,7 @@ type decoderUint16 struct {
fn func([]byte) uint16
}
-func decoderMakerUint16(fn interface{}) reflectx.Func {
+func decoderMakerUint16(fn any) reflectx.Func {
f := fn.(func([]byte) uint16)
return &decoderUint16{fn: f}
}
@@ -1175,12 +1175,12 @@ func (c *decoderUint16) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderUint16) Call(args []interface{}) []interface{} {
+func (c *decoderUint16) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderUint16) Call1x1(v interface{}) interface{} {
+func (c *decoderUint16) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -1188,7 +1188,7 @@ type decoderUint16E struct {
fn func([]byte) (uint16, error)
}
-func decoderMakerUint16E(fn interface{}) reflectx.Func {
+func decoderMakerUint16E(fn any) reflectx.Func {
f := fn.(func([]byte) (uint16, error))
return &decoderUint16E{fn: f}
}
@@ -1201,12 +1201,12 @@ func (c *decoderUint16E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderUint16E) Call(args []interface{}) []interface{} {
+func (c *decoderUint16E) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderUint16E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderUint16E) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -1214,7 +1214,7 @@ type decoderTUint16 struct {
fn func(reflect.Type, []byte) uint16
}
-func decoderMakerTUint16(fn interface{}) reflectx.Func {
+func decoderMakerTUint16(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) uint16)
return &decoderTUint16{fn: f}
}
@@ -1227,12 +1227,12 @@ func (c *decoderTUint16) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTUint16) Call(args []interface{}) []interface{} {
+func (c *decoderTUint16) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTUint16) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTUint16) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1240,7 +1240,7 @@ type decoderTUint16E struct {
fn func(reflect.Type, []byte) (uint16, error)
}
-func decoderMakerTUint16E(fn interface{}) reflectx.Func {
+func decoderMakerTUint16E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (uint16, error))
return &decoderTUint16E{fn: f}
}
@@ -1253,12 +1253,12 @@ func (c *decoderTUint16E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTUint16E) Call(args []interface{}) []interface{} {
+func (c *decoderTUint16E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTUint16E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTUint16E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1266,7 +1266,7 @@ type decoderUint32 struct {
fn func([]byte) uint32
}
-func decoderMakerUint32(fn interface{}) reflectx.Func {
+func decoderMakerUint32(fn any) reflectx.Func {
f := fn.(func([]byte) uint32)
return &decoderUint32{fn: f}
}
@@ -1279,12 +1279,12 @@ func (c *decoderUint32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderUint32) Call(args []interface{}) []interface{} {
+func (c *decoderUint32) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderUint32) Call1x1(v interface{}) interface{} {
+func (c *decoderUint32) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -1292,7 +1292,7 @@ type decoderUint32E struct {
fn func([]byte) (uint32, error)
}
-func decoderMakerUint32E(fn interface{}) reflectx.Func {
+func decoderMakerUint32E(fn any) reflectx.Func {
f := fn.(func([]byte) (uint32, error))
return &decoderUint32E{fn: f}
}
@@ -1305,12 +1305,12 @@ func (c *decoderUint32E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderUint32E) Call(args []interface{}) []interface{} {
+func (c *decoderUint32E) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderUint32E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderUint32E) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -1318,7 +1318,7 @@ type decoderTUint32 struct {
fn func(reflect.Type, []byte) uint32
}
-func decoderMakerTUint32(fn interface{}) reflectx.Func {
+func decoderMakerTUint32(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) uint32)
return &decoderTUint32{fn: f}
}
@@ -1331,12 +1331,12 @@ func (c *decoderTUint32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTUint32) Call(args []interface{}) []interface{} {
+func (c *decoderTUint32) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTUint32) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTUint32) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1344,7 +1344,7 @@ type decoderTUint32E struct {
fn func(reflect.Type, []byte) (uint32, error)
}
-func decoderMakerTUint32E(fn interface{}) reflectx.Func {
+func decoderMakerTUint32E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (uint32, error))
return &decoderTUint32E{fn: f}
}
@@ -1357,12 +1357,12 @@ func (c *decoderTUint32E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTUint32E) Call(args []interface{}) []interface{} {
+func (c *decoderTUint32E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTUint32E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTUint32E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1370,7 +1370,7 @@ type decoderUint64 struct {
fn func([]byte) uint64
}
-func decoderMakerUint64(fn interface{}) reflectx.Func {
+func decoderMakerUint64(fn any) reflectx.Func {
f := fn.(func([]byte) uint64)
return &decoderUint64{fn: f}
}
@@ -1383,12 +1383,12 @@ func (c *decoderUint64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderUint64) Call(args []interface{}) []interface{} {
+func (c *decoderUint64) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderUint64) Call1x1(v interface{}) interface{} {
+func (c *decoderUint64) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -1396,7 +1396,7 @@ type decoderUint64E struct {
fn func([]byte) (uint64, error)
}
-func decoderMakerUint64E(fn interface{}) reflectx.Func {
+func decoderMakerUint64E(fn any) reflectx.Func {
f := fn.(func([]byte) (uint64, error))
return &decoderUint64E{fn: f}
}
@@ -1409,12 +1409,12 @@ func (c *decoderUint64E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderUint64E) Call(args []interface{}) []interface{} {
+func (c *decoderUint64E) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderUint64E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderUint64E) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -1422,7 +1422,7 @@ type decoderTUint64 struct {
fn func(reflect.Type, []byte) uint64
}
-func decoderMakerTUint64(fn interface{}) reflectx.Func {
+func decoderMakerTUint64(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) uint64)
return &decoderTUint64{fn: f}
}
@@ -1435,12 +1435,12 @@ func (c *decoderTUint64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTUint64) Call(args []interface{}) []interface{} {
+func (c *decoderTUint64) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTUint64) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTUint64) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1448,7 +1448,7 @@ type decoderTUint64E struct {
fn func(reflect.Type, []byte) (uint64, error)
}
-func decoderMakerTUint64E(fn interface{}) reflectx.Func {
+func decoderMakerTUint64E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (uint64, error))
return &decoderTUint64E{fn: f}
}
@@ -1461,12 +1461,12 @@ func (c *decoderTUint64E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTUint64E) Call(args []interface{}) []interface{} {
+func (c *decoderTUint64E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTUint64E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTUint64E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1474,7 +1474,7 @@ type decoderFloat32 struct {
fn func([]byte) float32
}
-func decoderMakerFloat32(fn interface{}) reflectx.Func {
+func decoderMakerFloat32(fn any) reflectx.Func {
f := fn.(func([]byte) float32)
return &decoderFloat32{fn: f}
}
@@ -1487,12 +1487,12 @@ func (c *decoderFloat32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderFloat32) Call(args []interface{}) []interface{} {
+func (c *decoderFloat32) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderFloat32) Call1x1(v interface{}) interface{} {
+func (c *decoderFloat32) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -1500,7 +1500,7 @@ type decoderFloat32E struct {
fn func([]byte) (float32, error)
}
-func decoderMakerFloat32E(fn interface{}) reflectx.Func {
+func decoderMakerFloat32E(fn any) reflectx.Func {
f := fn.(func([]byte) (float32, error))
return &decoderFloat32E{fn: f}
}
@@ -1513,12 +1513,12 @@ func (c *decoderFloat32E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderFloat32E) Call(args []interface{}) []interface{} {
+func (c *decoderFloat32E) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderFloat32E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderFloat32E) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -1526,7 +1526,7 @@ type decoderTFloat32 struct {
fn func(reflect.Type, []byte) float32
}
-func decoderMakerTFloat32(fn interface{}) reflectx.Func {
+func decoderMakerTFloat32(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) float32)
return &decoderTFloat32{fn: f}
}
@@ -1539,12 +1539,12 @@ func (c *decoderTFloat32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTFloat32) Call(args []interface{}) []interface{} {
+func (c *decoderTFloat32) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTFloat32) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTFloat32) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1552,7 +1552,7 @@ type decoderTFloat32E struct {
fn func(reflect.Type, []byte) (float32, error)
}
-func decoderMakerTFloat32E(fn interface{}) reflectx.Func {
+func decoderMakerTFloat32E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (float32, error))
return &decoderTFloat32E{fn: f}
}
@@ -1565,12 +1565,12 @@ func (c *decoderTFloat32E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTFloat32E) Call(args []interface{}) []interface{} {
+func (c *decoderTFloat32E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTFloat32E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTFloat32E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1578,7 +1578,7 @@ type decoderFloat64 struct {
fn func([]byte) float64
}
-func decoderMakerFloat64(fn interface{}) reflectx.Func {
+func decoderMakerFloat64(fn any) reflectx.Func {
f := fn.(func([]byte) float64)
return &decoderFloat64{fn: f}
}
@@ -1591,12 +1591,12 @@ func (c *decoderFloat64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderFloat64) Call(args []interface{}) []interface{} {
+func (c *decoderFloat64) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderFloat64) Call1x1(v interface{}) interface{} {
+func (c *decoderFloat64) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -1604,7 +1604,7 @@ type decoderFloat64E struct {
fn func([]byte) (float64, error)
}
-func decoderMakerFloat64E(fn interface{}) reflectx.Func {
+func decoderMakerFloat64E(fn any) reflectx.Func {
f := fn.(func([]byte) (float64, error))
return &decoderFloat64E{fn: f}
}
@@ -1617,12 +1617,12 @@ func (c *decoderFloat64E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderFloat64E) Call(args []interface{}) []interface{} {
+func (c *decoderFloat64E) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderFloat64E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderFloat64E) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -1630,7 +1630,7 @@ type decoderTFloat64 struct {
fn func(reflect.Type, []byte) float64
}
-func decoderMakerTFloat64(fn interface{}) reflectx.Func {
+func decoderMakerTFloat64(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) float64)
return &decoderTFloat64{fn: f}
}
@@ -1643,12 +1643,12 @@ func (c *decoderTFloat64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTFloat64) Call(args []interface{}) []interface{} {
+func (c *decoderTFloat64) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTFloat64) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTFloat64) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1656,7 +1656,7 @@ type decoderTFloat64E struct {
fn func(reflect.Type, []byte) (float64, error)
}
-func decoderMakerTFloat64E(fn interface{}) reflectx.Func {
+func decoderMakerTFloat64E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (float64, error))
return &decoderTFloat64E{fn: f}
}
@@ -1669,12 +1669,12 @@ func (c *decoderTFloat64E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTFloat64E) Call(args []interface{}) []interface{} {
+func (c *decoderTFloat64E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTFloat64E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTFloat64E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1682,7 +1682,7 @@ type decoderTypex_T struct {
fn func([]byte) typex.T
}
-func decoderMakerTypex_T(fn interface{}) reflectx.Func {
+func decoderMakerTypex_T(fn any) reflectx.Func {
f := fn.(func([]byte) typex.T)
return &decoderTypex_T{fn: f}
}
@@ -1695,12 +1695,12 @@ func (c *decoderTypex_T) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTypex_T) Call(args []interface{}) []interface{} {
+func (c *decoderTypex_T) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTypex_T) Call1x1(v interface{}) interface{} {
+func (c *decoderTypex_T) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -1708,7 +1708,7 @@ type decoderTypex_TE struct {
fn func([]byte) (typex.T, error)
}
-func decoderMakerTypex_TE(fn interface{}) reflectx.Func {
+func decoderMakerTypex_TE(fn any) reflectx.Func {
f := fn.(func([]byte) (typex.T, error))
return &decoderTypex_TE{fn: f}
}
@@ -1721,12 +1721,12 @@ func (c *decoderTypex_TE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTypex_TE) Call(args []interface{}) []interface{} {
+func (c *decoderTypex_TE) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderTypex_TE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderTypex_TE) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -1734,7 +1734,7 @@ type decoderTTypex_T struct {
fn func(reflect.Type, []byte) typex.T
}
-func decoderMakerTTypex_T(fn interface{}) reflectx.Func {
+func decoderMakerTTypex_T(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) typex.T)
return &decoderTTypex_T{fn: f}
}
@@ -1747,12 +1747,12 @@ func (c *decoderTTypex_T) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTTypex_T) Call(args []interface{}) []interface{} {
+func (c *decoderTTypex_T) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTTypex_T) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTTypex_T) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1760,7 +1760,7 @@ type decoderTTypex_TE struct {
fn func(reflect.Type, []byte) (typex.T, error)
}
-func decoderMakerTTypex_TE(fn interface{}) reflectx.Func {
+func decoderMakerTTypex_TE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (typex.T, error))
return &decoderTTypex_TE{fn: f}
}
@@ -1773,12 +1773,12 @@ func (c *decoderTTypex_TE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTTypex_TE) Call(args []interface{}) []interface{} {
+func (c *decoderTTypex_TE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTTypex_TE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTTypex_TE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1786,7 +1786,7 @@ type decoderTypex_U struct {
fn func([]byte) typex.U
}
-func decoderMakerTypex_U(fn interface{}) reflectx.Func {
+func decoderMakerTypex_U(fn any) reflectx.Func {
f := fn.(func([]byte) typex.U)
return &decoderTypex_U{fn: f}
}
@@ -1799,12 +1799,12 @@ func (c *decoderTypex_U) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTypex_U) Call(args []interface{}) []interface{} {
+func (c *decoderTypex_U) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTypex_U) Call1x1(v interface{}) interface{} {
+func (c *decoderTypex_U) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -1812,7 +1812,7 @@ type decoderTypex_UE struct {
fn func([]byte) (typex.U, error)
}
-func decoderMakerTypex_UE(fn interface{}) reflectx.Func {
+func decoderMakerTypex_UE(fn any) reflectx.Func {
f := fn.(func([]byte) (typex.U, error))
return &decoderTypex_UE{fn: f}
}
@@ -1825,12 +1825,12 @@ func (c *decoderTypex_UE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTypex_UE) Call(args []interface{}) []interface{} {
+func (c *decoderTypex_UE) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderTypex_UE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderTypex_UE) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -1838,7 +1838,7 @@ type decoderTTypex_U struct {
fn func(reflect.Type, []byte) typex.U
}
-func decoderMakerTTypex_U(fn interface{}) reflectx.Func {
+func decoderMakerTTypex_U(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) typex.U)
return &decoderTTypex_U{fn: f}
}
@@ -1851,12 +1851,12 @@ func (c *decoderTTypex_U) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTTypex_U) Call(args []interface{}) []interface{} {
+func (c *decoderTTypex_U) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTTypex_U) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTTypex_U) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1864,7 +1864,7 @@ type decoderTTypex_UE struct {
fn func(reflect.Type, []byte) (typex.U, error)
}
-func decoderMakerTTypex_UE(fn interface{}) reflectx.Func {
+func decoderMakerTTypex_UE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (typex.U, error))
return &decoderTTypex_UE{fn: f}
}
@@ -1877,12 +1877,12 @@ func (c *decoderTTypex_UE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTTypex_UE) Call(args []interface{}) []interface{} {
+func (c *decoderTTypex_UE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTTypex_UE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTTypex_UE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1890,7 +1890,7 @@ type decoderTypex_V struct {
fn func([]byte) typex.V
}
-func decoderMakerTypex_V(fn interface{}) reflectx.Func {
+func decoderMakerTypex_V(fn any) reflectx.Func {
f := fn.(func([]byte) typex.V)
return &decoderTypex_V{fn: f}
}
@@ -1903,12 +1903,12 @@ func (c *decoderTypex_V) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTypex_V) Call(args []interface{}) []interface{} {
+func (c *decoderTypex_V) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTypex_V) Call1x1(v interface{}) interface{} {
+func (c *decoderTypex_V) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -1916,7 +1916,7 @@ type decoderTypex_VE struct {
fn func([]byte) (typex.V, error)
}
-func decoderMakerTypex_VE(fn interface{}) reflectx.Func {
+func decoderMakerTypex_VE(fn any) reflectx.Func {
f := fn.(func([]byte) (typex.V, error))
return &decoderTypex_VE{fn: f}
}
@@ -1929,12 +1929,12 @@ func (c *decoderTypex_VE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTypex_VE) Call(args []interface{}) []interface{} {
+func (c *decoderTypex_VE) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderTypex_VE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderTypex_VE) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -1942,7 +1942,7 @@ type decoderTTypex_V struct {
fn func(reflect.Type, []byte) typex.V
}
-func decoderMakerTTypex_V(fn interface{}) reflectx.Func {
+func decoderMakerTTypex_V(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) typex.V)
return &decoderTTypex_V{fn: f}
}
@@ -1955,12 +1955,12 @@ func (c *decoderTTypex_V) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTTypex_V) Call(args []interface{}) []interface{} {
+func (c *decoderTTypex_V) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTTypex_V) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTTypex_V) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1968,7 +1968,7 @@ type decoderTTypex_VE struct {
fn func(reflect.Type, []byte) (typex.V, error)
}
-func decoderMakerTTypex_VE(fn interface{}) reflectx.Func {
+func decoderMakerTTypex_VE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (typex.V, error))
return &decoderTTypex_VE{fn: f}
}
@@ -1981,12 +1981,12 @@ func (c *decoderTTypex_VE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTTypex_VE) Call(args []interface{}) []interface{} {
+func (c *decoderTTypex_VE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTTypex_VE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTTypex_VE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -1994,7 +1994,7 @@ type decoderTypex_W struct {
fn func([]byte) typex.W
}
-func decoderMakerTypex_W(fn interface{}) reflectx.Func {
+func decoderMakerTypex_W(fn any) reflectx.Func {
f := fn.(func([]byte) typex.W)
return &decoderTypex_W{fn: f}
}
@@ -2007,12 +2007,12 @@ func (c *decoderTypex_W) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTypex_W) Call(args []interface{}) []interface{} {
+func (c *decoderTypex_W) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTypex_W) Call1x1(v interface{}) interface{} {
+func (c *decoderTypex_W) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -2020,7 +2020,7 @@ type decoderTypex_WE struct {
fn func([]byte) (typex.W, error)
}
-func decoderMakerTypex_WE(fn interface{}) reflectx.Func {
+func decoderMakerTypex_WE(fn any) reflectx.Func {
f := fn.(func([]byte) (typex.W, error))
return &decoderTypex_WE{fn: f}
}
@@ -2033,12 +2033,12 @@ func (c *decoderTypex_WE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTypex_WE) Call(args []interface{}) []interface{} {
+func (c *decoderTypex_WE) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderTypex_WE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderTypex_WE) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -2046,7 +2046,7 @@ type decoderTTypex_W struct {
fn func(reflect.Type, []byte) typex.W
}
-func decoderMakerTTypex_W(fn interface{}) reflectx.Func {
+func decoderMakerTTypex_W(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) typex.W)
return &decoderTTypex_W{fn: f}
}
@@ -2059,12 +2059,12 @@ func (c *decoderTTypex_W) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTTypex_W) Call(args []interface{}) []interface{} {
+func (c *decoderTTypex_W) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTTypex_W) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTTypex_W) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -2072,7 +2072,7 @@ type decoderTTypex_WE struct {
fn func(reflect.Type, []byte) (typex.W, error)
}
-func decoderMakerTTypex_WE(fn interface{}) reflectx.Func {
+func decoderMakerTTypex_WE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (typex.W, error))
return &decoderTTypex_WE{fn: f}
}
@@ -2085,12 +2085,12 @@ func (c *decoderTTypex_WE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTTypex_WE) Call(args []interface{}) []interface{} {
+func (c *decoderTTypex_WE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTTypex_WE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTTypex_WE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -2098,7 +2098,7 @@ type decoderTypex_X struct {
fn func([]byte) typex.X
}
-func decoderMakerTypex_X(fn interface{}) reflectx.Func {
+func decoderMakerTypex_X(fn any) reflectx.Func {
f := fn.(func([]byte) typex.X)
return &decoderTypex_X{fn: f}
}
@@ -2111,12 +2111,12 @@ func (c *decoderTypex_X) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTypex_X) Call(args []interface{}) []interface{} {
+func (c *decoderTypex_X) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTypex_X) Call1x1(v interface{}) interface{} {
+func (c *decoderTypex_X) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -2124,7 +2124,7 @@ type decoderTypex_XE struct {
fn func([]byte) (typex.X, error)
}
-func decoderMakerTypex_XE(fn interface{}) reflectx.Func {
+func decoderMakerTypex_XE(fn any) reflectx.Func {
f := fn.(func([]byte) (typex.X, error))
return &decoderTypex_XE{fn: f}
}
@@ -2137,12 +2137,12 @@ func (c *decoderTypex_XE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTypex_XE) Call(args []interface{}) []interface{} {
+func (c *decoderTypex_XE) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderTypex_XE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderTypex_XE) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -2150,7 +2150,7 @@ type decoderTTypex_X struct {
fn func(reflect.Type, []byte) typex.X
}
-func decoderMakerTTypex_X(fn interface{}) reflectx.Func {
+func decoderMakerTTypex_X(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) typex.X)
return &decoderTTypex_X{fn: f}
}
@@ -2163,12 +2163,12 @@ func (c *decoderTTypex_X) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTTypex_X) Call(args []interface{}) []interface{} {
+func (c *decoderTTypex_X) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTTypex_X) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTTypex_X) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -2176,7 +2176,7 @@ type decoderTTypex_XE struct {
fn func(reflect.Type, []byte) (typex.X, error)
}
-func decoderMakerTTypex_XE(fn interface{}) reflectx.Func {
+func decoderMakerTTypex_XE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (typex.X, error))
return &decoderTTypex_XE{fn: f}
}
@@ -2189,12 +2189,12 @@ func (c *decoderTTypex_XE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTTypex_XE) Call(args []interface{}) []interface{} {
+func (c *decoderTTypex_XE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTTypex_XE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTTypex_XE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -2202,7 +2202,7 @@ type decoderTypex_Y struct {
fn func([]byte) typex.Y
}
-func decoderMakerTypex_Y(fn interface{}) reflectx.Func {
+func decoderMakerTypex_Y(fn any) reflectx.Func {
f := fn.(func([]byte) typex.Y)
return &decoderTypex_Y{fn: f}
}
@@ -2215,12 +2215,12 @@ func (c *decoderTypex_Y) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTypex_Y) Call(args []interface{}) []interface{} {
+func (c *decoderTypex_Y) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTypex_Y) Call1x1(v interface{}) interface{} {
+func (c *decoderTypex_Y) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -2228,7 +2228,7 @@ type decoderTypex_YE struct {
fn func([]byte) (typex.Y, error)
}
-func decoderMakerTypex_YE(fn interface{}) reflectx.Func {
+func decoderMakerTypex_YE(fn any) reflectx.Func {
f := fn.(func([]byte) (typex.Y, error))
return &decoderTypex_YE{fn: f}
}
@@ -2241,12 +2241,12 @@ func (c *decoderTypex_YE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTypex_YE) Call(args []interface{}) []interface{} {
+func (c *decoderTypex_YE) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderTypex_YE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderTypex_YE) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -2254,7 +2254,7 @@ type decoderTTypex_Y struct {
fn func(reflect.Type, []byte) typex.Y
}
-func decoderMakerTTypex_Y(fn interface{}) reflectx.Func {
+func decoderMakerTTypex_Y(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) typex.Y)
return &decoderTTypex_Y{fn: f}
}
@@ -2267,12 +2267,12 @@ func (c *decoderTTypex_Y) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTTypex_Y) Call(args []interface{}) []interface{} {
+func (c *decoderTTypex_Y) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTTypex_Y) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTTypex_Y) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -2280,7 +2280,7 @@ type decoderTTypex_YE struct {
fn func(reflect.Type, []byte) (typex.Y, error)
}
-func decoderMakerTTypex_YE(fn interface{}) reflectx.Func {
+func decoderMakerTTypex_YE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (typex.Y, error))
return &decoderTTypex_YE{fn: f}
}
@@ -2293,12 +2293,12 @@ func (c *decoderTTypex_YE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTTypex_YE) Call(args []interface{}) []interface{} {
+func (c *decoderTTypex_YE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTTypex_YE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTTypex_YE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -2306,7 +2306,7 @@ type decoderTypex_Z struct {
fn func([]byte) typex.Z
}
-func decoderMakerTypex_Z(fn interface{}) reflectx.Func {
+func decoderMakerTypex_Z(fn any) reflectx.Func {
f := fn.(func([]byte) typex.Z)
return &decoderTypex_Z{fn: f}
}
@@ -2319,12 +2319,12 @@ func (c *decoderTypex_Z) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTypex_Z) Call(args []interface{}) []interface{} {
+func (c *decoderTypex_Z) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTypex_Z) Call1x1(v interface{}) interface{} {
+func (c *decoderTypex_Z) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -2332,7 +2332,7 @@ type decoderTypex_ZE struct {
fn func([]byte) (typex.Z, error)
}
-func decoderMakerTypex_ZE(fn interface{}) reflectx.Func {
+func decoderMakerTypex_ZE(fn any) reflectx.Func {
f := fn.(func([]byte) (typex.Z, error))
return &decoderTypex_ZE{fn: f}
}
@@ -2345,12 +2345,12 @@ func (c *decoderTypex_ZE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTypex_ZE) Call(args []interface{}) []interface{} {
+func (c *decoderTypex_ZE) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoderTypex_ZE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoderTypex_ZE) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -2358,7 +2358,7 @@ type decoderTTypex_Z struct {
fn func(reflect.Type, []byte) typex.Z
}
-func decoderMakerTTypex_Z(fn interface{}) reflectx.Func {
+func decoderMakerTTypex_Z(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) typex.Z)
return &decoderTTypex_Z{fn: f}
}
@@ -2371,12 +2371,12 @@ func (c *decoderTTypex_Z) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTTypex_Z) Call(args []interface{}) []interface{} {
+func (c *decoderTTypex_Z) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderTTypex_Z) Call2x1(t, v interface{}) interface{} {
+func (c *decoderTTypex_Z) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -2384,7 +2384,7 @@ type decoderTTypex_ZE struct {
fn func(reflect.Type, []byte) (typex.Z, error)
}
-func decoderMakerTTypex_ZE(fn interface{}) reflectx.Func {
+func decoderMakerTTypex_ZE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, []byte) (typex.Z, error))
return &decoderTTypex_ZE{fn: f}
}
@@ -2397,11 +2397,11 @@ func (c *decoderTTypex_ZE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderTTypex_ZE) Call(args []interface{}) []interface{} {
+func (c *decoderTTypex_ZE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderTTypex_ZE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderTTypex_ZE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/optimized/decoders.tmpl b/sdks/go/pkg/beam/core/runtime/exec/optimized/decoders.tmpl
index 46746bb15fa..92b9c2561a6 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/optimized/decoders.tmpl
+++ b/sdks/go/pkg/beam/core/runtime/exec/optimized/decoders.tmpl
@@ -41,7 +41,7 @@ type decoder{{$x.Name}} struct {
fn func ([]byte){{$x.Type}}
}
-func decoderMaker{{$x.Name}}(fn interface{}) reflectx.Func {
+func decoderMaker{{$x.Name}}(fn any) reflectx.Func {
f := fn.(func ([]byte){{$x.Type}})
return &decoder{{$x.Name}}{fn: f}
}
@@ -54,12 +54,12 @@ func (c *decoder{{$x.Name}}) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoder{{$x.Name}}) Call(args []interface{}) []interface{} {
+func (c *decoder{{$x.Name}}) Call(args []any) []any {
out := c.fn(args[0].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoder{{$x.Name}}) Call1x1(v interface{}) interface{} {
+func (c *decoder{{$x.Name}}) Call1x1(v any) any {
return c.fn(v.([]byte))
}
@@ -68,7 +68,7 @@ type decoder{{$x.Name}}E struct {
fn func ([]byte) ({{$x.Type}}, error)
}
-func decoderMaker{{$x.Name}}E(fn interface{}) reflectx.Func {
+func decoderMaker{{$x.Name}}E(fn any) reflectx.Func {
f := fn.(func ([]byte)({{$x.Type}}, error))
return &decoder{{$x.Name}}E{fn: f}
}
@@ -81,12 +81,12 @@ func (c *decoder{{$x.Name}}E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoder{{$x.Name}}E) Call(args []interface{}) []interface{} {
+func (c *decoder{{$x.Name}}E) Call(args []any) []any {
v, err := c.fn(args[0].([]byte))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *decoder{{$x.Name}}E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *decoder{{$x.Name}}E) Call1x2(v any) (any, any) {
return c.fn(v.([]byte))
}
@@ -94,7 +94,7 @@ type decoderT{{$x.Name}} struct {
fn func (reflect.Type, []byte){{$x.Type}}
}
-func decoderMakerT{{$x.Name}}(fn interface{}) reflectx.Func {
+func decoderMakerT{{$x.Name}}(fn any) reflectx.Func {
f := fn.(func (reflect.Type, []byte){{$x.Type}})
return &decoderT{{$x.Name}}{fn: f}
}
@@ -107,12 +107,12 @@ func (c *decoderT{{$x.Name}}) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderT{{$x.Name}}) Call(args []interface{}) []interface{} {
+func (c *decoderT{{$x.Name}}) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{out}
+ return []any{out}
}
-func (c *decoderT{{$x.Name}}) Call2x1(t, v interface{}) interface{} {
+func (c *decoderT{{$x.Name}}) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.([]byte))
}
@@ -121,7 +121,7 @@ type decoderT{{$x.Name}}E struct {
fn func (reflect.Type, []byte) ({{$x.Type}}, error)
}
-func decoderMakerT{{$x.Name}}E(fn interface{}) reflectx.Func {
+func decoderMakerT{{$x.Name}}E(fn any) reflectx.Func {
f := fn.(func (reflect.Type, []byte)({{$x.Type}}, error))
return &decoderT{{$x.Name}}E{fn: f}
}
@@ -134,12 +134,12 @@ func (c *decoderT{{$x.Name}}E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *decoderT{{$x.Name}}E) Call(args []interface{}) []interface{} {
+func (c *decoderT{{$x.Name}}E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].([]byte))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *decoderT{{$x.Name}}E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *decoderT{{$x.Name}}E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.([]byte))
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/optimized/emitters.go b/sdks/go/pkg/beam/core/runtime/exec/optimized/emitters.go
index 35ae2d4ecf3..83b60abe0b1 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/optimized/emitters.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/optimized/emitters.go
@@ -1043,7 +1043,7 @@ func init() {
type emitNative struct {
n exec.ElementProcessor
- fn interface{}
+ fn any
est *sdf.WatermarkEstimator
ctx context.Context
@@ -1059,7 +1059,7 @@ func (e *emitNative) Init(ctx context.Context, ws []typex.Window, et typex.Event
return nil
}
-func (e *emitNative) Value() interface{} {
+func (e *emitNative) Value() any {
return e.fn
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/optimized/emitters.tmpl b/sdks/go/pkg/beam/core/runtime/exec/optimized/emitters.tmpl
index 95ff34f2942..3e6feb85a9e 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/optimized/emitters.tmpl
+++ b/sdks/go/pkg/beam/core/runtime/exec/optimized/emitters.tmpl
@@ -40,7 +40,7 @@ func init() {
type emitNative struct {
n exec.ElementProcessor
- fn interface{}
+ fn any
est *sdf.WatermarkEstimator
ctx context.Context
@@ -56,7 +56,7 @@ func (e *emitNative) Init(ctx context.Context, ws []typex.Window, et typex.Even
return nil
}
-func (e *emitNative) Value() interface{} {
+func (e *emitNative) Value() any {
return e.fn
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/optimized/encoders.go b/sdks/go/pkg/beam/core/runtime/exec/optimized/encoders.go
index 1e670f0745e..f2e613cba24 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/optimized/encoders.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/optimized/encoders.go
@@ -118,7 +118,7 @@ type encoderBool struct {
fn func(bool) []byte
}
-func encoderMakerBool(fn interface{}) reflectx.Func {
+func encoderMakerBool(fn any) reflectx.Func {
f := fn.(func(bool) []byte)
return &encoderBool{fn: f}
}
@@ -131,12 +131,12 @@ func (c *encoderBool) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderBool) Call(args []interface{}) []interface{} {
+func (c *encoderBool) Call(args []any) []any {
out := c.fn(args[0].(bool))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderBool) Call1x1(v interface{}) interface{} {
+func (c *encoderBool) Call1x1(v any) any {
return c.fn(v.(bool))
}
@@ -144,7 +144,7 @@ type encoderBoolE struct {
fn func(bool) ([]byte, error)
}
-func encoderMakerBoolE(fn interface{}) reflectx.Func {
+func encoderMakerBoolE(fn any) reflectx.Func {
f := fn.(func(bool) ([]byte, error))
return &encoderBoolE{fn: f}
}
@@ -157,12 +157,12 @@ func (c *encoderBoolE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderBoolE) Call(args []interface{}) []interface{} {
+func (c *encoderBoolE) Call(args []any) []any {
v, err := c.fn(args[0].(bool))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderBoolE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderBoolE) Call1x2(v any) (any, any) {
return c.fn(v.(bool))
}
@@ -170,7 +170,7 @@ type encoderTBool struct {
fn func(reflect.Type, bool) []byte
}
-func encoderMakerTBool(fn interface{}) reflectx.Func {
+func encoderMakerTBool(fn any) reflectx.Func {
f := fn.(func(reflect.Type, bool) []byte)
return &encoderTBool{fn: f}
}
@@ -183,12 +183,12 @@ func (c *encoderTBool) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTBool) Call(args []interface{}) []interface{} {
+func (c *encoderTBool) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(bool))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTBool) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTBool) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(bool))
}
@@ -196,7 +196,7 @@ type encoderTBoolE struct {
fn func(reflect.Type, bool) ([]byte, error)
}
-func encoderMakerTBoolE(fn interface{}) reflectx.Func {
+func encoderMakerTBoolE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, bool) ([]byte, error))
return &encoderTBoolE{fn: f}
}
@@ -209,12 +209,12 @@ func (c *encoderTBoolE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTBoolE) Call(args []interface{}) []interface{} {
+func (c *encoderTBoolE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(bool))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTBoolE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTBoolE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(bool))
}
@@ -222,7 +222,7 @@ type encoderString struct {
fn func(string) []byte
}
-func encoderMakerString(fn interface{}) reflectx.Func {
+func encoderMakerString(fn any) reflectx.Func {
f := fn.(func(string) []byte)
return &encoderString{fn: f}
}
@@ -235,12 +235,12 @@ func (c *encoderString) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderString) Call(args []interface{}) []interface{} {
+func (c *encoderString) Call(args []any) []any {
out := c.fn(args[0].(string))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderString) Call1x1(v interface{}) interface{} {
+func (c *encoderString) Call1x1(v any) any {
return c.fn(v.(string))
}
@@ -248,7 +248,7 @@ type encoderStringE struct {
fn func(string) ([]byte, error)
}
-func encoderMakerStringE(fn interface{}) reflectx.Func {
+func encoderMakerStringE(fn any) reflectx.Func {
f := fn.(func(string) ([]byte, error))
return &encoderStringE{fn: f}
}
@@ -261,12 +261,12 @@ func (c *encoderStringE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderStringE) Call(args []interface{}) []interface{} {
+func (c *encoderStringE) Call(args []any) []any {
v, err := c.fn(args[0].(string))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderStringE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderStringE) Call1x2(v any) (any, any) {
return c.fn(v.(string))
}
@@ -274,7 +274,7 @@ type encoderTString struct {
fn func(reflect.Type, string) []byte
}
-func encoderMakerTString(fn interface{}) reflectx.Func {
+func encoderMakerTString(fn any) reflectx.Func {
f := fn.(func(reflect.Type, string) []byte)
return &encoderTString{fn: f}
}
@@ -287,12 +287,12 @@ func (c *encoderTString) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTString) Call(args []interface{}) []interface{} {
+func (c *encoderTString) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(string))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTString) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTString) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(string))
}
@@ -300,7 +300,7 @@ type encoderTStringE struct {
fn func(reflect.Type, string) ([]byte, error)
}
-func encoderMakerTStringE(fn interface{}) reflectx.Func {
+func encoderMakerTStringE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, string) ([]byte, error))
return &encoderTStringE{fn: f}
}
@@ -313,12 +313,12 @@ func (c *encoderTStringE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTStringE) Call(args []interface{}) []interface{} {
+func (c *encoderTStringE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(string))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTStringE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTStringE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(string))
}
@@ -326,7 +326,7 @@ type encoderInt struct {
fn func(int) []byte
}
-func encoderMakerInt(fn interface{}) reflectx.Func {
+func encoderMakerInt(fn any) reflectx.Func {
f := fn.(func(int) []byte)
return &encoderInt{fn: f}
}
@@ -339,12 +339,12 @@ func (c *encoderInt) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderInt) Call(args []interface{}) []interface{} {
+func (c *encoderInt) Call(args []any) []any {
out := c.fn(args[0].(int))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderInt) Call1x1(v interface{}) interface{} {
+func (c *encoderInt) Call1x1(v any) any {
return c.fn(v.(int))
}
@@ -352,7 +352,7 @@ type encoderIntE struct {
fn func(int) ([]byte, error)
}
-func encoderMakerIntE(fn interface{}) reflectx.Func {
+func encoderMakerIntE(fn any) reflectx.Func {
f := fn.(func(int) ([]byte, error))
return &encoderIntE{fn: f}
}
@@ -365,12 +365,12 @@ func (c *encoderIntE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderIntE) Call(args []interface{}) []interface{} {
+func (c *encoderIntE) Call(args []any) []any {
v, err := c.fn(args[0].(int))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderIntE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderIntE) Call1x2(v any) (any, any) {
return c.fn(v.(int))
}
@@ -378,7 +378,7 @@ type encoderTInt struct {
fn func(reflect.Type, int) []byte
}
-func encoderMakerTInt(fn interface{}) reflectx.Func {
+func encoderMakerTInt(fn any) reflectx.Func {
f := fn.(func(reflect.Type, int) []byte)
return &encoderTInt{fn: f}
}
@@ -391,12 +391,12 @@ func (c *encoderTInt) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTInt) Call(args []interface{}) []interface{} {
+func (c *encoderTInt) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(int))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTInt) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTInt) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(int))
}
@@ -404,7 +404,7 @@ type encoderTIntE struct {
fn func(reflect.Type, int) ([]byte, error)
}
-func encoderMakerTIntE(fn interface{}) reflectx.Func {
+func encoderMakerTIntE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, int) ([]byte, error))
return &encoderTIntE{fn: f}
}
@@ -417,12 +417,12 @@ func (c *encoderTIntE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTIntE) Call(args []interface{}) []interface{} {
+func (c *encoderTIntE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(int))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTIntE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTIntE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(int))
}
@@ -430,7 +430,7 @@ type encoderInt8 struct {
fn func(int8) []byte
}
-func encoderMakerInt8(fn interface{}) reflectx.Func {
+func encoderMakerInt8(fn any) reflectx.Func {
f := fn.(func(int8) []byte)
return &encoderInt8{fn: f}
}
@@ -443,12 +443,12 @@ func (c *encoderInt8) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderInt8) Call(args []interface{}) []interface{} {
+func (c *encoderInt8) Call(args []any) []any {
out := c.fn(args[0].(int8))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderInt8) Call1x1(v interface{}) interface{} {
+func (c *encoderInt8) Call1x1(v any) any {
return c.fn(v.(int8))
}
@@ -456,7 +456,7 @@ type encoderInt8E struct {
fn func(int8) ([]byte, error)
}
-func encoderMakerInt8E(fn interface{}) reflectx.Func {
+func encoderMakerInt8E(fn any) reflectx.Func {
f := fn.(func(int8) ([]byte, error))
return &encoderInt8E{fn: f}
}
@@ -469,12 +469,12 @@ func (c *encoderInt8E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderInt8E) Call(args []interface{}) []interface{} {
+func (c *encoderInt8E) Call(args []any) []any {
v, err := c.fn(args[0].(int8))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderInt8E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderInt8E) Call1x2(v any) (any, any) {
return c.fn(v.(int8))
}
@@ -482,7 +482,7 @@ type encoderTInt8 struct {
fn func(reflect.Type, int8) []byte
}
-func encoderMakerTInt8(fn interface{}) reflectx.Func {
+func encoderMakerTInt8(fn any) reflectx.Func {
f := fn.(func(reflect.Type, int8) []byte)
return &encoderTInt8{fn: f}
}
@@ -495,12 +495,12 @@ func (c *encoderTInt8) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTInt8) Call(args []interface{}) []interface{} {
+func (c *encoderTInt8) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(int8))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTInt8) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTInt8) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(int8))
}
@@ -508,7 +508,7 @@ type encoderTInt8E struct {
fn func(reflect.Type, int8) ([]byte, error)
}
-func encoderMakerTInt8E(fn interface{}) reflectx.Func {
+func encoderMakerTInt8E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, int8) ([]byte, error))
return &encoderTInt8E{fn: f}
}
@@ -521,12 +521,12 @@ func (c *encoderTInt8E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTInt8E) Call(args []interface{}) []interface{} {
+func (c *encoderTInt8E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(int8))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTInt8E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTInt8E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(int8))
}
@@ -534,7 +534,7 @@ type encoderInt16 struct {
fn func(int16) []byte
}
-func encoderMakerInt16(fn interface{}) reflectx.Func {
+func encoderMakerInt16(fn any) reflectx.Func {
f := fn.(func(int16) []byte)
return &encoderInt16{fn: f}
}
@@ -547,12 +547,12 @@ func (c *encoderInt16) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderInt16) Call(args []interface{}) []interface{} {
+func (c *encoderInt16) Call(args []any) []any {
out := c.fn(args[0].(int16))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderInt16) Call1x1(v interface{}) interface{} {
+func (c *encoderInt16) Call1x1(v any) any {
return c.fn(v.(int16))
}
@@ -560,7 +560,7 @@ type encoderInt16E struct {
fn func(int16) ([]byte, error)
}
-func encoderMakerInt16E(fn interface{}) reflectx.Func {
+func encoderMakerInt16E(fn any) reflectx.Func {
f := fn.(func(int16) ([]byte, error))
return &encoderInt16E{fn: f}
}
@@ -573,12 +573,12 @@ func (c *encoderInt16E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderInt16E) Call(args []interface{}) []interface{} {
+func (c *encoderInt16E) Call(args []any) []any {
v, err := c.fn(args[0].(int16))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderInt16E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderInt16E) Call1x2(v any) (any, any) {
return c.fn(v.(int16))
}
@@ -586,7 +586,7 @@ type encoderTInt16 struct {
fn func(reflect.Type, int16) []byte
}
-func encoderMakerTInt16(fn interface{}) reflectx.Func {
+func encoderMakerTInt16(fn any) reflectx.Func {
f := fn.(func(reflect.Type, int16) []byte)
return &encoderTInt16{fn: f}
}
@@ -599,12 +599,12 @@ func (c *encoderTInt16) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTInt16) Call(args []interface{}) []interface{} {
+func (c *encoderTInt16) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(int16))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTInt16) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTInt16) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(int16))
}
@@ -612,7 +612,7 @@ type encoderTInt16E struct {
fn func(reflect.Type, int16) ([]byte, error)
}
-func encoderMakerTInt16E(fn interface{}) reflectx.Func {
+func encoderMakerTInt16E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, int16) ([]byte, error))
return &encoderTInt16E{fn: f}
}
@@ -625,12 +625,12 @@ func (c *encoderTInt16E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTInt16E) Call(args []interface{}) []interface{} {
+func (c *encoderTInt16E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(int16))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTInt16E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTInt16E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(int16))
}
@@ -638,7 +638,7 @@ type encoderInt32 struct {
fn func(int32) []byte
}
-func encoderMakerInt32(fn interface{}) reflectx.Func {
+func encoderMakerInt32(fn any) reflectx.Func {
f := fn.(func(int32) []byte)
return &encoderInt32{fn: f}
}
@@ -651,12 +651,12 @@ func (c *encoderInt32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderInt32) Call(args []interface{}) []interface{} {
+func (c *encoderInt32) Call(args []any) []any {
out := c.fn(args[0].(int32))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderInt32) Call1x1(v interface{}) interface{} {
+func (c *encoderInt32) Call1x1(v any) any {
return c.fn(v.(int32))
}
@@ -664,7 +664,7 @@ type encoderInt32E struct {
fn func(int32) ([]byte, error)
}
-func encoderMakerInt32E(fn interface{}) reflectx.Func {
+func encoderMakerInt32E(fn any) reflectx.Func {
f := fn.(func(int32) ([]byte, error))
return &encoderInt32E{fn: f}
}
@@ -677,12 +677,12 @@ func (c *encoderInt32E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderInt32E) Call(args []interface{}) []interface{} {
+func (c *encoderInt32E) Call(args []any) []any {
v, err := c.fn(args[0].(int32))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderInt32E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderInt32E) Call1x2(v any) (any, any) {
return c.fn(v.(int32))
}
@@ -690,7 +690,7 @@ type encoderTInt32 struct {
fn func(reflect.Type, int32) []byte
}
-func encoderMakerTInt32(fn interface{}) reflectx.Func {
+func encoderMakerTInt32(fn any) reflectx.Func {
f := fn.(func(reflect.Type, int32) []byte)
return &encoderTInt32{fn: f}
}
@@ -703,12 +703,12 @@ func (c *encoderTInt32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTInt32) Call(args []interface{}) []interface{} {
+func (c *encoderTInt32) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(int32))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTInt32) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTInt32) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(int32))
}
@@ -716,7 +716,7 @@ type encoderTInt32E struct {
fn func(reflect.Type, int32) ([]byte, error)
}
-func encoderMakerTInt32E(fn interface{}) reflectx.Func {
+func encoderMakerTInt32E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, int32) ([]byte, error))
return &encoderTInt32E{fn: f}
}
@@ -729,12 +729,12 @@ func (c *encoderTInt32E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTInt32E) Call(args []interface{}) []interface{} {
+func (c *encoderTInt32E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(int32))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTInt32E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTInt32E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(int32))
}
@@ -742,7 +742,7 @@ type encoderInt64 struct {
fn func(int64) []byte
}
-func encoderMakerInt64(fn interface{}) reflectx.Func {
+func encoderMakerInt64(fn any) reflectx.Func {
f := fn.(func(int64) []byte)
return &encoderInt64{fn: f}
}
@@ -755,12 +755,12 @@ func (c *encoderInt64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderInt64) Call(args []interface{}) []interface{} {
+func (c *encoderInt64) Call(args []any) []any {
out := c.fn(args[0].(int64))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderInt64) Call1x1(v interface{}) interface{} {
+func (c *encoderInt64) Call1x1(v any) any {
return c.fn(v.(int64))
}
@@ -768,7 +768,7 @@ type encoderInt64E struct {
fn func(int64) ([]byte, error)
}
-func encoderMakerInt64E(fn interface{}) reflectx.Func {
+func encoderMakerInt64E(fn any) reflectx.Func {
f := fn.(func(int64) ([]byte, error))
return &encoderInt64E{fn: f}
}
@@ -781,12 +781,12 @@ func (c *encoderInt64E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderInt64E) Call(args []interface{}) []interface{} {
+func (c *encoderInt64E) Call(args []any) []any {
v, err := c.fn(args[0].(int64))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderInt64E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderInt64E) Call1x2(v any) (any, any) {
return c.fn(v.(int64))
}
@@ -794,7 +794,7 @@ type encoderTInt64 struct {
fn func(reflect.Type, int64) []byte
}
-func encoderMakerTInt64(fn interface{}) reflectx.Func {
+func encoderMakerTInt64(fn any) reflectx.Func {
f := fn.(func(reflect.Type, int64) []byte)
return &encoderTInt64{fn: f}
}
@@ -807,12 +807,12 @@ func (c *encoderTInt64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTInt64) Call(args []interface{}) []interface{} {
+func (c *encoderTInt64) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(int64))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTInt64) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTInt64) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(int64))
}
@@ -820,7 +820,7 @@ type encoderTInt64E struct {
fn func(reflect.Type, int64) ([]byte, error)
}
-func encoderMakerTInt64E(fn interface{}) reflectx.Func {
+func encoderMakerTInt64E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, int64) ([]byte, error))
return &encoderTInt64E{fn: f}
}
@@ -833,12 +833,12 @@ func (c *encoderTInt64E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTInt64E) Call(args []interface{}) []interface{} {
+func (c *encoderTInt64E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(int64))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTInt64E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTInt64E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(int64))
}
@@ -846,7 +846,7 @@ type encoderUint struct {
fn func(uint) []byte
}
-func encoderMakerUint(fn interface{}) reflectx.Func {
+func encoderMakerUint(fn any) reflectx.Func {
f := fn.(func(uint) []byte)
return &encoderUint{fn: f}
}
@@ -859,12 +859,12 @@ func (c *encoderUint) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderUint) Call(args []interface{}) []interface{} {
+func (c *encoderUint) Call(args []any) []any {
out := c.fn(args[0].(uint))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderUint) Call1x1(v interface{}) interface{} {
+func (c *encoderUint) Call1x1(v any) any {
return c.fn(v.(uint))
}
@@ -872,7 +872,7 @@ type encoderUintE struct {
fn func(uint) ([]byte, error)
}
-func encoderMakerUintE(fn interface{}) reflectx.Func {
+func encoderMakerUintE(fn any) reflectx.Func {
f := fn.(func(uint) ([]byte, error))
return &encoderUintE{fn: f}
}
@@ -885,12 +885,12 @@ func (c *encoderUintE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderUintE) Call(args []interface{}) []interface{} {
+func (c *encoderUintE) Call(args []any) []any {
v, err := c.fn(args[0].(uint))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderUintE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderUintE) Call1x2(v any) (any, any) {
return c.fn(v.(uint))
}
@@ -898,7 +898,7 @@ type encoderTUint struct {
fn func(reflect.Type, uint) []byte
}
-func encoderMakerTUint(fn interface{}) reflectx.Func {
+func encoderMakerTUint(fn any) reflectx.Func {
f := fn.(func(reflect.Type, uint) []byte)
return &encoderTUint{fn: f}
}
@@ -911,12 +911,12 @@ func (c *encoderTUint) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTUint) Call(args []interface{}) []interface{} {
+func (c *encoderTUint) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(uint))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTUint) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTUint) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(uint))
}
@@ -924,7 +924,7 @@ type encoderTUintE struct {
fn func(reflect.Type, uint) ([]byte, error)
}
-func encoderMakerTUintE(fn interface{}) reflectx.Func {
+func encoderMakerTUintE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, uint) ([]byte, error))
return &encoderTUintE{fn: f}
}
@@ -937,12 +937,12 @@ func (c *encoderTUintE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTUintE) Call(args []interface{}) []interface{} {
+func (c *encoderTUintE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(uint))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTUintE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTUintE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(uint))
}
@@ -950,7 +950,7 @@ type encoderUint8 struct {
fn func(uint8) []byte
}
-func encoderMakerUint8(fn interface{}) reflectx.Func {
+func encoderMakerUint8(fn any) reflectx.Func {
f := fn.(func(uint8) []byte)
return &encoderUint8{fn: f}
}
@@ -963,12 +963,12 @@ func (c *encoderUint8) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderUint8) Call(args []interface{}) []interface{} {
+func (c *encoderUint8) Call(args []any) []any {
out := c.fn(args[0].(uint8))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderUint8) Call1x1(v interface{}) interface{} {
+func (c *encoderUint8) Call1x1(v any) any {
return c.fn(v.(uint8))
}
@@ -976,7 +976,7 @@ type encoderUint8E struct {
fn func(uint8) ([]byte, error)
}
-func encoderMakerUint8E(fn interface{}) reflectx.Func {
+func encoderMakerUint8E(fn any) reflectx.Func {
f := fn.(func(uint8) ([]byte, error))
return &encoderUint8E{fn: f}
}
@@ -989,12 +989,12 @@ func (c *encoderUint8E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderUint8E) Call(args []interface{}) []interface{} {
+func (c *encoderUint8E) Call(args []any) []any {
v, err := c.fn(args[0].(uint8))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderUint8E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderUint8E) Call1x2(v any) (any, any) {
return c.fn(v.(uint8))
}
@@ -1002,7 +1002,7 @@ type encoderTUint8 struct {
fn func(reflect.Type, uint8) []byte
}
-func encoderMakerTUint8(fn interface{}) reflectx.Func {
+func encoderMakerTUint8(fn any) reflectx.Func {
f := fn.(func(reflect.Type, uint8) []byte)
return &encoderTUint8{fn: f}
}
@@ -1015,12 +1015,12 @@ func (c *encoderTUint8) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTUint8) Call(args []interface{}) []interface{} {
+func (c *encoderTUint8) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(uint8))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTUint8) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTUint8) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(uint8))
}
@@ -1028,7 +1028,7 @@ type encoderTUint8E struct {
fn func(reflect.Type, uint8) ([]byte, error)
}
-func encoderMakerTUint8E(fn interface{}) reflectx.Func {
+func encoderMakerTUint8E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, uint8) ([]byte, error))
return &encoderTUint8E{fn: f}
}
@@ -1041,12 +1041,12 @@ func (c *encoderTUint8E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTUint8E) Call(args []interface{}) []interface{} {
+func (c *encoderTUint8E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(uint8))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTUint8E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTUint8E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(uint8))
}
@@ -1054,7 +1054,7 @@ type encoderUint16 struct {
fn func(uint16) []byte
}
-func encoderMakerUint16(fn interface{}) reflectx.Func {
+func encoderMakerUint16(fn any) reflectx.Func {
f := fn.(func(uint16) []byte)
return &encoderUint16{fn: f}
}
@@ -1067,12 +1067,12 @@ func (c *encoderUint16) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderUint16) Call(args []interface{}) []interface{} {
+func (c *encoderUint16) Call(args []any) []any {
out := c.fn(args[0].(uint16))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderUint16) Call1x1(v interface{}) interface{} {
+func (c *encoderUint16) Call1x1(v any) any {
return c.fn(v.(uint16))
}
@@ -1080,7 +1080,7 @@ type encoderUint16E struct {
fn func(uint16) ([]byte, error)
}
-func encoderMakerUint16E(fn interface{}) reflectx.Func {
+func encoderMakerUint16E(fn any) reflectx.Func {
f := fn.(func(uint16) ([]byte, error))
return &encoderUint16E{fn: f}
}
@@ -1093,12 +1093,12 @@ func (c *encoderUint16E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderUint16E) Call(args []interface{}) []interface{} {
+func (c *encoderUint16E) Call(args []any) []any {
v, err := c.fn(args[0].(uint16))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderUint16E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderUint16E) Call1x2(v any) (any, any) {
return c.fn(v.(uint16))
}
@@ -1106,7 +1106,7 @@ type encoderTUint16 struct {
fn func(reflect.Type, uint16) []byte
}
-func encoderMakerTUint16(fn interface{}) reflectx.Func {
+func encoderMakerTUint16(fn any) reflectx.Func {
f := fn.(func(reflect.Type, uint16) []byte)
return &encoderTUint16{fn: f}
}
@@ -1119,12 +1119,12 @@ func (c *encoderTUint16) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTUint16) Call(args []interface{}) []interface{} {
+func (c *encoderTUint16) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(uint16))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTUint16) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTUint16) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(uint16))
}
@@ -1132,7 +1132,7 @@ type encoderTUint16E struct {
fn func(reflect.Type, uint16) ([]byte, error)
}
-func encoderMakerTUint16E(fn interface{}) reflectx.Func {
+func encoderMakerTUint16E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, uint16) ([]byte, error))
return &encoderTUint16E{fn: f}
}
@@ -1145,12 +1145,12 @@ func (c *encoderTUint16E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTUint16E) Call(args []interface{}) []interface{} {
+func (c *encoderTUint16E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(uint16))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTUint16E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTUint16E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(uint16))
}
@@ -1158,7 +1158,7 @@ type encoderUint32 struct {
fn func(uint32) []byte
}
-func encoderMakerUint32(fn interface{}) reflectx.Func {
+func encoderMakerUint32(fn any) reflectx.Func {
f := fn.(func(uint32) []byte)
return &encoderUint32{fn: f}
}
@@ -1171,12 +1171,12 @@ func (c *encoderUint32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderUint32) Call(args []interface{}) []interface{} {
+func (c *encoderUint32) Call(args []any) []any {
out := c.fn(args[0].(uint32))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderUint32) Call1x1(v interface{}) interface{} {
+func (c *encoderUint32) Call1x1(v any) any {
return c.fn(v.(uint32))
}
@@ -1184,7 +1184,7 @@ type encoderUint32E struct {
fn func(uint32) ([]byte, error)
}
-func encoderMakerUint32E(fn interface{}) reflectx.Func {
+func encoderMakerUint32E(fn any) reflectx.Func {
f := fn.(func(uint32) ([]byte, error))
return &encoderUint32E{fn: f}
}
@@ -1197,12 +1197,12 @@ func (c *encoderUint32E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderUint32E) Call(args []interface{}) []interface{} {
+func (c *encoderUint32E) Call(args []any) []any {
v, err := c.fn(args[0].(uint32))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderUint32E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderUint32E) Call1x2(v any) (any, any) {
return c.fn(v.(uint32))
}
@@ -1210,7 +1210,7 @@ type encoderTUint32 struct {
fn func(reflect.Type, uint32) []byte
}
-func encoderMakerTUint32(fn interface{}) reflectx.Func {
+func encoderMakerTUint32(fn any) reflectx.Func {
f := fn.(func(reflect.Type, uint32) []byte)
return &encoderTUint32{fn: f}
}
@@ -1223,12 +1223,12 @@ func (c *encoderTUint32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTUint32) Call(args []interface{}) []interface{} {
+func (c *encoderTUint32) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(uint32))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTUint32) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTUint32) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(uint32))
}
@@ -1236,7 +1236,7 @@ type encoderTUint32E struct {
fn func(reflect.Type, uint32) ([]byte, error)
}
-func encoderMakerTUint32E(fn interface{}) reflectx.Func {
+func encoderMakerTUint32E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, uint32) ([]byte, error))
return &encoderTUint32E{fn: f}
}
@@ -1249,12 +1249,12 @@ func (c *encoderTUint32E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTUint32E) Call(args []interface{}) []interface{} {
+func (c *encoderTUint32E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(uint32))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTUint32E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTUint32E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(uint32))
}
@@ -1262,7 +1262,7 @@ type encoderUint64 struct {
fn func(uint64) []byte
}
-func encoderMakerUint64(fn interface{}) reflectx.Func {
+func encoderMakerUint64(fn any) reflectx.Func {
f := fn.(func(uint64) []byte)
return &encoderUint64{fn: f}
}
@@ -1275,12 +1275,12 @@ func (c *encoderUint64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderUint64) Call(args []interface{}) []interface{} {
+func (c *encoderUint64) Call(args []any) []any {
out := c.fn(args[0].(uint64))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderUint64) Call1x1(v interface{}) interface{} {
+func (c *encoderUint64) Call1x1(v any) any {
return c.fn(v.(uint64))
}
@@ -1288,7 +1288,7 @@ type encoderUint64E struct {
fn func(uint64) ([]byte, error)
}
-func encoderMakerUint64E(fn interface{}) reflectx.Func {
+func encoderMakerUint64E(fn any) reflectx.Func {
f := fn.(func(uint64) ([]byte, error))
return &encoderUint64E{fn: f}
}
@@ -1301,12 +1301,12 @@ func (c *encoderUint64E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderUint64E) Call(args []interface{}) []interface{} {
+func (c *encoderUint64E) Call(args []any) []any {
v, err := c.fn(args[0].(uint64))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderUint64E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderUint64E) Call1x2(v any) (any, any) {
return c.fn(v.(uint64))
}
@@ -1314,7 +1314,7 @@ type encoderTUint64 struct {
fn func(reflect.Type, uint64) []byte
}
-func encoderMakerTUint64(fn interface{}) reflectx.Func {
+func encoderMakerTUint64(fn any) reflectx.Func {
f := fn.(func(reflect.Type, uint64) []byte)
return &encoderTUint64{fn: f}
}
@@ -1327,12 +1327,12 @@ func (c *encoderTUint64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTUint64) Call(args []interface{}) []interface{} {
+func (c *encoderTUint64) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(uint64))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTUint64) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTUint64) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(uint64))
}
@@ -1340,7 +1340,7 @@ type encoderTUint64E struct {
fn func(reflect.Type, uint64) ([]byte, error)
}
-func encoderMakerTUint64E(fn interface{}) reflectx.Func {
+func encoderMakerTUint64E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, uint64) ([]byte, error))
return &encoderTUint64E{fn: f}
}
@@ -1353,12 +1353,12 @@ func (c *encoderTUint64E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTUint64E) Call(args []interface{}) []interface{} {
+func (c *encoderTUint64E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(uint64))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTUint64E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTUint64E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(uint64))
}
@@ -1366,7 +1366,7 @@ type encoderFloat32 struct {
fn func(float32) []byte
}
-func encoderMakerFloat32(fn interface{}) reflectx.Func {
+func encoderMakerFloat32(fn any) reflectx.Func {
f := fn.(func(float32) []byte)
return &encoderFloat32{fn: f}
}
@@ -1379,12 +1379,12 @@ func (c *encoderFloat32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderFloat32) Call(args []interface{}) []interface{} {
+func (c *encoderFloat32) Call(args []any) []any {
out := c.fn(args[0].(float32))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderFloat32) Call1x1(v interface{}) interface{} {
+func (c *encoderFloat32) Call1x1(v any) any {
return c.fn(v.(float32))
}
@@ -1392,7 +1392,7 @@ type encoderFloat32E struct {
fn func(float32) ([]byte, error)
}
-func encoderMakerFloat32E(fn interface{}) reflectx.Func {
+func encoderMakerFloat32E(fn any) reflectx.Func {
f := fn.(func(float32) ([]byte, error))
return &encoderFloat32E{fn: f}
}
@@ -1405,12 +1405,12 @@ func (c *encoderFloat32E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderFloat32E) Call(args []interface{}) []interface{} {
+func (c *encoderFloat32E) Call(args []any) []any {
v, err := c.fn(args[0].(float32))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderFloat32E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderFloat32E) Call1x2(v any) (any, any) {
return c.fn(v.(float32))
}
@@ -1418,7 +1418,7 @@ type encoderTFloat32 struct {
fn func(reflect.Type, float32) []byte
}
-func encoderMakerTFloat32(fn interface{}) reflectx.Func {
+func encoderMakerTFloat32(fn any) reflectx.Func {
f := fn.(func(reflect.Type, float32) []byte)
return &encoderTFloat32{fn: f}
}
@@ -1431,12 +1431,12 @@ func (c *encoderTFloat32) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTFloat32) Call(args []interface{}) []interface{} {
+func (c *encoderTFloat32) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(float32))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTFloat32) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTFloat32) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(float32))
}
@@ -1444,7 +1444,7 @@ type encoderTFloat32E struct {
fn func(reflect.Type, float32) ([]byte, error)
}
-func encoderMakerTFloat32E(fn interface{}) reflectx.Func {
+func encoderMakerTFloat32E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, float32) ([]byte, error))
return &encoderTFloat32E{fn: f}
}
@@ -1457,12 +1457,12 @@ func (c *encoderTFloat32E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTFloat32E) Call(args []interface{}) []interface{} {
+func (c *encoderTFloat32E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(float32))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTFloat32E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTFloat32E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(float32))
}
@@ -1470,7 +1470,7 @@ type encoderFloat64 struct {
fn func(float64) []byte
}
-func encoderMakerFloat64(fn interface{}) reflectx.Func {
+func encoderMakerFloat64(fn any) reflectx.Func {
f := fn.(func(float64) []byte)
return &encoderFloat64{fn: f}
}
@@ -1483,12 +1483,12 @@ func (c *encoderFloat64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderFloat64) Call(args []interface{}) []interface{} {
+func (c *encoderFloat64) Call(args []any) []any {
out := c.fn(args[0].(float64))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderFloat64) Call1x1(v interface{}) interface{} {
+func (c *encoderFloat64) Call1x1(v any) any {
return c.fn(v.(float64))
}
@@ -1496,7 +1496,7 @@ type encoderFloat64E struct {
fn func(float64) ([]byte, error)
}
-func encoderMakerFloat64E(fn interface{}) reflectx.Func {
+func encoderMakerFloat64E(fn any) reflectx.Func {
f := fn.(func(float64) ([]byte, error))
return &encoderFloat64E{fn: f}
}
@@ -1509,12 +1509,12 @@ func (c *encoderFloat64E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderFloat64E) Call(args []interface{}) []interface{} {
+func (c *encoderFloat64E) Call(args []any) []any {
v, err := c.fn(args[0].(float64))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderFloat64E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderFloat64E) Call1x2(v any) (any, any) {
return c.fn(v.(float64))
}
@@ -1522,7 +1522,7 @@ type encoderTFloat64 struct {
fn func(reflect.Type, float64) []byte
}
-func encoderMakerTFloat64(fn interface{}) reflectx.Func {
+func encoderMakerTFloat64(fn any) reflectx.Func {
f := fn.(func(reflect.Type, float64) []byte)
return &encoderTFloat64{fn: f}
}
@@ -1535,12 +1535,12 @@ func (c *encoderTFloat64) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTFloat64) Call(args []interface{}) []interface{} {
+func (c *encoderTFloat64) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(float64))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTFloat64) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTFloat64) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(float64))
}
@@ -1548,7 +1548,7 @@ type encoderTFloat64E struct {
fn func(reflect.Type, float64) ([]byte, error)
}
-func encoderMakerTFloat64E(fn interface{}) reflectx.Func {
+func encoderMakerTFloat64E(fn any) reflectx.Func {
f := fn.(func(reflect.Type, float64) ([]byte, error))
return &encoderTFloat64E{fn: f}
}
@@ -1561,12 +1561,12 @@ func (c *encoderTFloat64E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTFloat64E) Call(args []interface{}) []interface{} {
+func (c *encoderTFloat64E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(float64))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTFloat64E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTFloat64E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(float64))
}
@@ -1574,7 +1574,7 @@ type encoderTypex_T struct {
fn func(typex.T) []byte
}
-func encoderMakerTypex_T(fn interface{}) reflectx.Func {
+func encoderMakerTypex_T(fn any) reflectx.Func {
f := fn.(func(typex.T) []byte)
return &encoderTypex_T{fn: f}
}
@@ -1587,12 +1587,12 @@ func (c *encoderTypex_T) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTypex_T) Call(args []interface{}) []interface{} {
+func (c *encoderTypex_T) Call(args []any) []any {
out := c.fn(args[0].(typex.T))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTypex_T) Call1x1(v interface{}) interface{} {
+func (c *encoderTypex_T) Call1x1(v any) any {
return c.fn(v.(typex.T))
}
@@ -1600,7 +1600,7 @@ type encoderTypex_TE struct {
fn func(typex.T) ([]byte, error)
}
-func encoderMakerTypex_TE(fn interface{}) reflectx.Func {
+func encoderMakerTypex_TE(fn any) reflectx.Func {
f := fn.(func(typex.T) ([]byte, error))
return &encoderTypex_TE{fn: f}
}
@@ -1613,12 +1613,12 @@ func (c *encoderTypex_TE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTypex_TE) Call(args []interface{}) []interface{} {
+func (c *encoderTypex_TE) Call(args []any) []any {
v, err := c.fn(args[0].(typex.T))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderTypex_TE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderTypex_TE) Call1x2(v any) (any, any) {
return c.fn(v.(typex.T))
}
@@ -1626,7 +1626,7 @@ type encoderTTypex_T struct {
fn func(reflect.Type, typex.T) []byte
}
-func encoderMakerTTypex_T(fn interface{}) reflectx.Func {
+func encoderMakerTTypex_T(fn any) reflectx.Func {
f := fn.(func(reflect.Type, typex.T) []byte)
return &encoderTTypex_T{fn: f}
}
@@ -1639,12 +1639,12 @@ func (c *encoderTTypex_T) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTTypex_T) Call(args []interface{}) []interface{} {
+func (c *encoderTTypex_T) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(typex.T))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTTypex_T) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTTypex_T) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(typex.T))
}
@@ -1652,7 +1652,7 @@ type encoderTTypex_TE struct {
fn func(reflect.Type, typex.T) ([]byte, error)
}
-func encoderMakerTTypex_TE(fn interface{}) reflectx.Func {
+func encoderMakerTTypex_TE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, typex.T) ([]byte, error))
return &encoderTTypex_TE{fn: f}
}
@@ -1665,12 +1665,12 @@ func (c *encoderTTypex_TE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTTypex_TE) Call(args []interface{}) []interface{} {
+func (c *encoderTTypex_TE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(typex.T))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTTypex_TE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTTypex_TE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(typex.T))
}
@@ -1678,7 +1678,7 @@ type encoderTypex_U struct {
fn func(typex.U) []byte
}
-func encoderMakerTypex_U(fn interface{}) reflectx.Func {
+func encoderMakerTypex_U(fn any) reflectx.Func {
f := fn.(func(typex.U) []byte)
return &encoderTypex_U{fn: f}
}
@@ -1691,12 +1691,12 @@ func (c *encoderTypex_U) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTypex_U) Call(args []interface{}) []interface{} {
+func (c *encoderTypex_U) Call(args []any) []any {
out := c.fn(args[0].(typex.U))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTypex_U) Call1x1(v interface{}) interface{} {
+func (c *encoderTypex_U) Call1x1(v any) any {
return c.fn(v.(typex.U))
}
@@ -1704,7 +1704,7 @@ type encoderTypex_UE struct {
fn func(typex.U) ([]byte, error)
}
-func encoderMakerTypex_UE(fn interface{}) reflectx.Func {
+func encoderMakerTypex_UE(fn any) reflectx.Func {
f := fn.(func(typex.U) ([]byte, error))
return &encoderTypex_UE{fn: f}
}
@@ -1717,12 +1717,12 @@ func (c *encoderTypex_UE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTypex_UE) Call(args []interface{}) []interface{} {
+func (c *encoderTypex_UE) Call(args []any) []any {
v, err := c.fn(args[0].(typex.U))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderTypex_UE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderTypex_UE) Call1x2(v any) (any, any) {
return c.fn(v.(typex.U))
}
@@ -1730,7 +1730,7 @@ type encoderTTypex_U struct {
fn func(reflect.Type, typex.U) []byte
}
-func encoderMakerTTypex_U(fn interface{}) reflectx.Func {
+func encoderMakerTTypex_U(fn any) reflectx.Func {
f := fn.(func(reflect.Type, typex.U) []byte)
return &encoderTTypex_U{fn: f}
}
@@ -1743,12 +1743,12 @@ func (c *encoderTTypex_U) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTTypex_U) Call(args []interface{}) []interface{} {
+func (c *encoderTTypex_U) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(typex.U))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTTypex_U) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTTypex_U) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(typex.U))
}
@@ -1756,7 +1756,7 @@ type encoderTTypex_UE struct {
fn func(reflect.Type, typex.U) ([]byte, error)
}
-func encoderMakerTTypex_UE(fn interface{}) reflectx.Func {
+func encoderMakerTTypex_UE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, typex.U) ([]byte, error))
return &encoderTTypex_UE{fn: f}
}
@@ -1769,12 +1769,12 @@ func (c *encoderTTypex_UE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTTypex_UE) Call(args []interface{}) []interface{} {
+func (c *encoderTTypex_UE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(typex.U))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTTypex_UE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTTypex_UE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(typex.U))
}
@@ -1782,7 +1782,7 @@ type encoderTypex_V struct {
fn func(typex.V) []byte
}
-func encoderMakerTypex_V(fn interface{}) reflectx.Func {
+func encoderMakerTypex_V(fn any) reflectx.Func {
f := fn.(func(typex.V) []byte)
return &encoderTypex_V{fn: f}
}
@@ -1795,12 +1795,12 @@ func (c *encoderTypex_V) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTypex_V) Call(args []interface{}) []interface{} {
+func (c *encoderTypex_V) Call(args []any) []any {
out := c.fn(args[0].(typex.V))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTypex_V) Call1x1(v interface{}) interface{} {
+func (c *encoderTypex_V) Call1x1(v any) any {
return c.fn(v.(typex.V))
}
@@ -1808,7 +1808,7 @@ type encoderTypex_VE struct {
fn func(typex.V) ([]byte, error)
}
-func encoderMakerTypex_VE(fn interface{}) reflectx.Func {
+func encoderMakerTypex_VE(fn any) reflectx.Func {
f := fn.(func(typex.V) ([]byte, error))
return &encoderTypex_VE{fn: f}
}
@@ -1821,12 +1821,12 @@ func (c *encoderTypex_VE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTypex_VE) Call(args []interface{}) []interface{} {
+func (c *encoderTypex_VE) Call(args []any) []any {
v, err := c.fn(args[0].(typex.V))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderTypex_VE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderTypex_VE) Call1x2(v any) (any, any) {
return c.fn(v.(typex.V))
}
@@ -1834,7 +1834,7 @@ type encoderTTypex_V struct {
fn func(reflect.Type, typex.V) []byte
}
-func encoderMakerTTypex_V(fn interface{}) reflectx.Func {
+func encoderMakerTTypex_V(fn any) reflectx.Func {
f := fn.(func(reflect.Type, typex.V) []byte)
return &encoderTTypex_V{fn: f}
}
@@ -1847,12 +1847,12 @@ func (c *encoderTTypex_V) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTTypex_V) Call(args []interface{}) []interface{} {
+func (c *encoderTTypex_V) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(typex.V))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTTypex_V) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTTypex_V) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(typex.V))
}
@@ -1860,7 +1860,7 @@ type encoderTTypex_VE struct {
fn func(reflect.Type, typex.V) ([]byte, error)
}
-func encoderMakerTTypex_VE(fn interface{}) reflectx.Func {
+func encoderMakerTTypex_VE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, typex.V) ([]byte, error))
return &encoderTTypex_VE{fn: f}
}
@@ -1873,12 +1873,12 @@ func (c *encoderTTypex_VE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTTypex_VE) Call(args []interface{}) []interface{} {
+func (c *encoderTTypex_VE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(typex.V))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTTypex_VE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTTypex_VE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(typex.V))
}
@@ -1886,7 +1886,7 @@ type encoderTypex_W struct {
fn func(typex.W) []byte
}
-func encoderMakerTypex_W(fn interface{}) reflectx.Func {
+func encoderMakerTypex_W(fn any) reflectx.Func {
f := fn.(func(typex.W) []byte)
return &encoderTypex_W{fn: f}
}
@@ -1899,12 +1899,12 @@ func (c *encoderTypex_W) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTypex_W) Call(args []interface{}) []interface{} {
+func (c *encoderTypex_W) Call(args []any) []any {
out := c.fn(args[0].(typex.W))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTypex_W) Call1x1(v interface{}) interface{} {
+func (c *encoderTypex_W) Call1x1(v any) any {
return c.fn(v.(typex.W))
}
@@ -1912,7 +1912,7 @@ type encoderTypex_WE struct {
fn func(typex.W) ([]byte, error)
}
-func encoderMakerTypex_WE(fn interface{}) reflectx.Func {
+func encoderMakerTypex_WE(fn any) reflectx.Func {
f := fn.(func(typex.W) ([]byte, error))
return &encoderTypex_WE{fn: f}
}
@@ -1925,12 +1925,12 @@ func (c *encoderTypex_WE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTypex_WE) Call(args []interface{}) []interface{} {
+func (c *encoderTypex_WE) Call(args []any) []any {
v, err := c.fn(args[0].(typex.W))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderTypex_WE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderTypex_WE) Call1x2(v any) (any, any) {
return c.fn(v.(typex.W))
}
@@ -1938,7 +1938,7 @@ type encoderTTypex_W struct {
fn func(reflect.Type, typex.W) []byte
}
-func encoderMakerTTypex_W(fn interface{}) reflectx.Func {
+func encoderMakerTTypex_W(fn any) reflectx.Func {
f := fn.(func(reflect.Type, typex.W) []byte)
return &encoderTTypex_W{fn: f}
}
@@ -1951,12 +1951,12 @@ func (c *encoderTTypex_W) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTTypex_W) Call(args []interface{}) []interface{} {
+func (c *encoderTTypex_W) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(typex.W))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTTypex_W) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTTypex_W) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(typex.W))
}
@@ -1964,7 +1964,7 @@ type encoderTTypex_WE struct {
fn func(reflect.Type, typex.W) ([]byte, error)
}
-func encoderMakerTTypex_WE(fn interface{}) reflectx.Func {
+func encoderMakerTTypex_WE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, typex.W) ([]byte, error))
return &encoderTTypex_WE{fn: f}
}
@@ -1977,12 +1977,12 @@ func (c *encoderTTypex_WE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTTypex_WE) Call(args []interface{}) []interface{} {
+func (c *encoderTTypex_WE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(typex.W))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTTypex_WE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTTypex_WE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(typex.W))
}
@@ -1990,7 +1990,7 @@ type encoderTypex_X struct {
fn func(typex.X) []byte
}
-func encoderMakerTypex_X(fn interface{}) reflectx.Func {
+func encoderMakerTypex_X(fn any) reflectx.Func {
f := fn.(func(typex.X) []byte)
return &encoderTypex_X{fn: f}
}
@@ -2003,12 +2003,12 @@ func (c *encoderTypex_X) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTypex_X) Call(args []interface{}) []interface{} {
+func (c *encoderTypex_X) Call(args []any) []any {
out := c.fn(args[0].(typex.X))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTypex_X) Call1x1(v interface{}) interface{} {
+func (c *encoderTypex_X) Call1x1(v any) any {
return c.fn(v.(typex.X))
}
@@ -2016,7 +2016,7 @@ type encoderTypex_XE struct {
fn func(typex.X) ([]byte, error)
}
-func encoderMakerTypex_XE(fn interface{}) reflectx.Func {
+func encoderMakerTypex_XE(fn any) reflectx.Func {
f := fn.(func(typex.X) ([]byte, error))
return &encoderTypex_XE{fn: f}
}
@@ -2029,12 +2029,12 @@ func (c *encoderTypex_XE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTypex_XE) Call(args []interface{}) []interface{} {
+func (c *encoderTypex_XE) Call(args []any) []any {
v, err := c.fn(args[0].(typex.X))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderTypex_XE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderTypex_XE) Call1x2(v any) (any, any) {
return c.fn(v.(typex.X))
}
@@ -2042,7 +2042,7 @@ type encoderTTypex_X struct {
fn func(reflect.Type, typex.X) []byte
}
-func encoderMakerTTypex_X(fn interface{}) reflectx.Func {
+func encoderMakerTTypex_X(fn any) reflectx.Func {
f := fn.(func(reflect.Type, typex.X) []byte)
return &encoderTTypex_X{fn: f}
}
@@ -2055,12 +2055,12 @@ func (c *encoderTTypex_X) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTTypex_X) Call(args []interface{}) []interface{} {
+func (c *encoderTTypex_X) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(typex.X))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTTypex_X) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTTypex_X) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(typex.X))
}
@@ -2068,7 +2068,7 @@ type encoderTTypex_XE struct {
fn func(reflect.Type, typex.X) ([]byte, error)
}
-func encoderMakerTTypex_XE(fn interface{}) reflectx.Func {
+func encoderMakerTTypex_XE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, typex.X) ([]byte, error))
return &encoderTTypex_XE{fn: f}
}
@@ -2081,12 +2081,12 @@ func (c *encoderTTypex_XE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTTypex_XE) Call(args []interface{}) []interface{} {
+func (c *encoderTTypex_XE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(typex.X))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTTypex_XE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTTypex_XE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(typex.X))
}
@@ -2094,7 +2094,7 @@ type encoderTypex_Y struct {
fn func(typex.Y) []byte
}
-func encoderMakerTypex_Y(fn interface{}) reflectx.Func {
+func encoderMakerTypex_Y(fn any) reflectx.Func {
f := fn.(func(typex.Y) []byte)
return &encoderTypex_Y{fn: f}
}
@@ -2107,12 +2107,12 @@ func (c *encoderTypex_Y) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTypex_Y) Call(args []interface{}) []interface{} {
+func (c *encoderTypex_Y) Call(args []any) []any {
out := c.fn(args[0].(typex.Y))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTypex_Y) Call1x1(v interface{}) interface{} {
+func (c *encoderTypex_Y) Call1x1(v any) any {
return c.fn(v.(typex.Y))
}
@@ -2120,7 +2120,7 @@ type encoderTypex_YE struct {
fn func(typex.Y) ([]byte, error)
}
-func encoderMakerTypex_YE(fn interface{}) reflectx.Func {
+func encoderMakerTypex_YE(fn any) reflectx.Func {
f := fn.(func(typex.Y) ([]byte, error))
return &encoderTypex_YE{fn: f}
}
@@ -2133,12 +2133,12 @@ func (c *encoderTypex_YE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTypex_YE) Call(args []interface{}) []interface{} {
+func (c *encoderTypex_YE) Call(args []any) []any {
v, err := c.fn(args[0].(typex.Y))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderTypex_YE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderTypex_YE) Call1x2(v any) (any, any) {
return c.fn(v.(typex.Y))
}
@@ -2146,7 +2146,7 @@ type encoderTTypex_Y struct {
fn func(reflect.Type, typex.Y) []byte
}
-func encoderMakerTTypex_Y(fn interface{}) reflectx.Func {
+func encoderMakerTTypex_Y(fn any) reflectx.Func {
f := fn.(func(reflect.Type, typex.Y) []byte)
return &encoderTTypex_Y{fn: f}
}
@@ -2159,12 +2159,12 @@ func (c *encoderTTypex_Y) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTTypex_Y) Call(args []interface{}) []interface{} {
+func (c *encoderTTypex_Y) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(typex.Y))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTTypex_Y) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTTypex_Y) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(typex.Y))
}
@@ -2172,7 +2172,7 @@ type encoderTTypex_YE struct {
fn func(reflect.Type, typex.Y) ([]byte, error)
}
-func encoderMakerTTypex_YE(fn interface{}) reflectx.Func {
+func encoderMakerTTypex_YE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, typex.Y) ([]byte, error))
return &encoderTTypex_YE{fn: f}
}
@@ -2185,12 +2185,12 @@ func (c *encoderTTypex_YE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTTypex_YE) Call(args []interface{}) []interface{} {
+func (c *encoderTTypex_YE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(typex.Y))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTTypex_YE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTTypex_YE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(typex.Y))
}
@@ -2198,7 +2198,7 @@ type encoderTypex_Z struct {
fn func(typex.Z) []byte
}
-func encoderMakerTypex_Z(fn interface{}) reflectx.Func {
+func encoderMakerTypex_Z(fn any) reflectx.Func {
f := fn.(func(typex.Z) []byte)
return &encoderTypex_Z{fn: f}
}
@@ -2211,12 +2211,12 @@ func (c *encoderTypex_Z) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTypex_Z) Call(args []interface{}) []interface{} {
+func (c *encoderTypex_Z) Call(args []any) []any {
out := c.fn(args[0].(typex.Z))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTypex_Z) Call1x1(v interface{}) interface{} {
+func (c *encoderTypex_Z) Call1x1(v any) any {
return c.fn(v.(typex.Z))
}
@@ -2224,7 +2224,7 @@ type encoderTypex_ZE struct {
fn func(typex.Z) ([]byte, error)
}
-func encoderMakerTypex_ZE(fn interface{}) reflectx.Func {
+func encoderMakerTypex_ZE(fn any) reflectx.Func {
f := fn.(func(typex.Z) ([]byte, error))
return &encoderTypex_ZE{fn: f}
}
@@ -2237,12 +2237,12 @@ func (c *encoderTypex_ZE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTypex_ZE) Call(args []interface{}) []interface{} {
+func (c *encoderTypex_ZE) Call(args []any) []any {
v, err := c.fn(args[0].(typex.Z))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoderTypex_ZE) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoderTypex_ZE) Call1x2(v any) (any, any) {
return c.fn(v.(typex.Z))
}
@@ -2250,7 +2250,7 @@ type encoderTTypex_Z struct {
fn func(reflect.Type, typex.Z) []byte
}
-func encoderMakerTTypex_Z(fn interface{}) reflectx.Func {
+func encoderMakerTTypex_Z(fn any) reflectx.Func {
f := fn.(func(reflect.Type, typex.Z) []byte)
return &encoderTTypex_Z{fn: f}
}
@@ -2263,12 +2263,12 @@ func (c *encoderTTypex_Z) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTTypex_Z) Call(args []interface{}) []interface{} {
+func (c *encoderTTypex_Z) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].(typex.Z))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderTTypex_Z) Call2x1(t, v interface{}) interface{} {
+func (c *encoderTTypex_Z) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.(typex.Z))
}
@@ -2276,7 +2276,7 @@ type encoderTTypex_ZE struct {
fn func(reflect.Type, typex.Z) ([]byte, error)
}
-func encoderMakerTTypex_ZE(fn interface{}) reflectx.Func {
+func encoderMakerTTypex_ZE(fn any) reflectx.Func {
f := fn.(func(reflect.Type, typex.Z) ([]byte, error))
return &encoderTTypex_ZE{fn: f}
}
@@ -2289,11 +2289,11 @@ func (c *encoderTTypex_ZE) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderTTypex_ZE) Call(args []interface{}) []interface{} {
+func (c *encoderTTypex_ZE) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].(typex.Z))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderTTypex_ZE) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderTTypex_ZE) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.(typex.Z))
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/optimized/encoders.tmpl b/sdks/go/pkg/beam/core/runtime/exec/optimized/encoders.tmpl
index a960382cc2a..2beeb2e09a1 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/optimized/encoders.tmpl
+++ b/sdks/go/pkg/beam/core/runtime/exec/optimized/encoders.tmpl
@@ -41,7 +41,7 @@ type encoder{{$x.Name}} struct {
fn func ({{$x.Type}})[]byte
}
-func encoderMaker{{$x.Name}}(fn interface{}) reflectx.Func {
+func encoderMaker{{$x.Name}}(fn any) reflectx.Func {
f := fn.(func ({{$x.Type}})[]byte)
return &encoder{{$x.Name}}{fn: f}
}
@@ -54,12 +54,12 @@ func (c *encoder{{$x.Name}}) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoder{{$x.Name}}) Call(args []interface{}) []interface{} {
+func (c *encoder{{$x.Name}}) Call(args []any) []any {
out := c.fn(args[0].({{$x.Type}}))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoder{{$x.Name}}) Call1x1(v interface{}) interface{} {
+func (c *encoder{{$x.Name}}) Call1x1(v any) any {
return c.fn(v.({{$x.Type}}))
}
@@ -68,7 +68,7 @@ type encoder{{$x.Name}}E struct {
fn func ({{$x.Type}}) ([]byte, error)
}
-func encoderMaker{{$x.Name}}E(fn interface{}) reflectx.Func {
+func encoderMaker{{$x.Name}}E(fn any) reflectx.Func {
f := fn.(func ({{$x.Type}})([]byte, error))
return &encoder{{$x.Name}}E{fn: f}
}
@@ -81,12 +81,12 @@ func (c *encoder{{$x.Name}}E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoder{{$x.Name}}E) Call(args []interface{}) []interface{} {
+func (c *encoder{{$x.Name}}E) Call(args []any) []any {
v, err := c.fn(args[0].({{$x.Type}}))
- return []interface{}{v, err}
+ return []any{v, err}
}
-func (c *encoder{{$x.Name}}E) Call1x2(v interface{}) (interface{}, interface{}) {
+func (c *encoder{{$x.Name}}E) Call1x2(v any) (any, any) {
return c.fn(v.({{$x.Type}}))
}
@@ -94,7 +94,7 @@ type encoderT{{$x.Name}} struct {
fn func (reflect.Type, {{$x.Type}})[]byte
}
-func encoderMakerT{{$x.Name}}(fn interface{}) reflectx.Func {
+func encoderMakerT{{$x.Name}}(fn any) reflectx.Func {
f := fn.(func (reflect.Type, {{$x.Type}})[]byte)
return &encoderT{{$x.Name}}{fn: f}
}
@@ -107,12 +107,12 @@ func (c *encoderT{{$x.Name}}) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderT{{$x.Name}}) Call(args []interface{}) []interface{} {
+func (c *encoderT{{$x.Name}}) Call(args []any) []any {
out := c.fn(args[0].(reflect.Type), args[1].({{$x.Type}}))
- return []interface{}{out}
+ return []any{out}
}
-func (c *encoderT{{$x.Name}}) Call2x1(t, v interface{}) interface{} {
+func (c *encoderT{{$x.Name}}) Call2x1(t, v any) any {
return c.fn(t.(reflect.Type), v.({{$x.Type}}))
}
@@ -121,7 +121,7 @@ type encoderT{{$x.Name}}E struct {
fn func (reflect.Type, {{$x.Type}}) ([]byte, error)
}
-func encoderMakerT{{$x.Name}}E(fn interface{}) reflectx.Func {
+func encoderMakerT{{$x.Name}}E(fn any) reflectx.Func {
f := fn.(func (reflect.Type, {{$x.Type}})([]byte, error))
return &encoderT{{$x.Name}}E{fn: f}
}
@@ -134,12 +134,12 @@ func (c *encoderT{{$x.Name}}E) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *encoderT{{$x.Name}}E) Call(args []interface{}) []interface{} {
+func (c *encoderT{{$x.Name}}E) Call(args []any) []any {
val, err := c.fn(args[0].(reflect.Type), args[1].({{$x.Type}}))
- return []interface{}{val, err}
+ return []any{val, err}
}
-func (c *encoderT{{$x.Name}}E) Call2x2(t, v interface{}) (interface{}, interface{}) {
+func (c *encoderT{{$x.Name}}E) Call2x2(t, v any) (any, any) {
return c.fn(t.(reflect.Type), v.({{$x.Type}}))
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/optimized/inputs.go b/sdks/go/pkg/beam/core/runtime/exec/optimized/inputs.go
index 3a1ae8eba0b..a92dd0ee444 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/optimized/inputs.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/optimized/inputs.go
@@ -537,7 +537,7 @@ func init() {
type iterNative struct {
s exec.ReStream
- fn interface{}
+ fn any
// cur is the "current" stream, if any.
cur exec.Stream
@@ -552,7 +552,7 @@ func (v *iterNative) Init() error {
return nil
}
-func (v *iterNative) Value() interface{} {
+func (v *iterNative) Value() any {
return v.fn
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/optimized/inputs.tmpl b/sdks/go/pkg/beam/core/runtime/exec/optimized/inputs.tmpl
index f9d78dc061a..14b55f8fbdd 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/optimized/inputs.tmpl
+++ b/sdks/go/pkg/beam/core/runtime/exec/optimized/inputs.tmpl
@@ -38,7 +38,7 @@ func init() {
type iterNative struct {
s exec.ReStream
- fn interface{}
+ fn any
// cur is the "current" stream, if any.
cur exec.Stream
@@ -53,7 +53,7 @@ func (v *iterNative) Init() error {
return nil
}
-func (v *iterNative) Value() interface{} {
+func (v *iterNative) Value() any {
return v.fn
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/pardo.go b/sdks/go/pkg/beam/core/runtime/exec/pardo.go
index 42de145db80..8cb5342ded8 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/pardo.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/pardo.go
@@ -66,7 +66,7 @@ func (n *ParDo) GetPID() string {
type cacheElm struct {
key typex.Window
sideinput []ReusableInput
- extra []interface{}
+ extra []any
}
// ID returns the UnitID for this ParDo.
@@ -268,7 +268,7 @@ func (n *ParDo) initSideInput(ctx context.Context, w typex.Window) error {
n.cache = &cacheElm{
key: w,
- extra: make([]interface{}, sideCount+emitCount),
+ extra: make([]any, sideCount+emitCount),
}
attachEstimator := false
if n.we != nil {
diff --git a/sdks/go/pkg/beam/core/runtime/exec/pardo_test.go b/sdks/go/pkg/beam/core/runtime/exec/pardo_test.go
index 9e9054675c4..b228bfd0d7e 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/pardo_test.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/pardo_test.go
@@ -217,21 +217,21 @@ func TestParDo_WindowObservation(t *testing.T) {
func TestProcessSingleWindow_withOutputs(t *testing.T) {
tests := []struct {
name string
- inputFn interface{}
- input []interface{}
- expectedOutput []interface{}
+ inputFn any
+ input []any
+ expectedOutput []any
}{
{
"forwarding case",
func(a string) (string, error) { return a, nil },
- []interface{}{"a", "b", "c"},
- []interface{}{"a", "b", "c"},
+ []any{"a", "b", "c"},
+ []any{"a", "b", "c"},
},
{
"continuation case",
func(a string) (string, sdf.ProcessContinuation, error) { return a, sdf.StopProcessing(), nil },
- []interface{}{"a", "b", "c"},
- []interface{}{"a", "b", "c"},
+ []any{"a", "b", "c"},
+ []any{"a", "b", "c"},
},
}
for _, test := range tests {
@@ -348,7 +348,7 @@ func TestProcessSingleWindow_errorCase(t *testing.T) {
}
}
-func makeInputsWithUnfinishedRestrictions(values ...interface{}) []MainInput {
+func makeInputsWithUnfinishedRestrictions(values ...any) []MainInput {
initial := makeInput(values...)
var restrictedIns []MainInput
for _, mainIn := range initial {
@@ -411,7 +411,7 @@ func (fn *noReturnSplittable) ProcessElement(rt *sdf.LockRTracker, a string, emi
func TestProcessSingleWindow_dataLossCase(t *testing.T) {
tests := []struct {
name string
- inputFn interface{}
+ inputFn any
input *MainInput
}{
{
diff --git a/sdks/go/pkg/beam/core/runtime/exec/pcollection_test.go b/sdks/go/pkg/beam/core/runtime/exec/pcollection_test.go
index 1212c3c2bf7..1cb6adee97d 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/pcollection_test.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/pcollection_test.go
@@ -33,7 +33,7 @@ func TestPCollection(t *testing.T) {
pcol := &PCollection{UID: 2, Out: a, Coder: coder.NewVarInt()}
// The "large" 2nd value is to ensure the values are encoded properly,
// and that Min & Max are behaving.
- inputs := []interface{}{int64(1), int64(2000000000), int64(3)}
+ inputs := []any{int64(1), int64(2000000000), int64(3)}
in := &FixedRoot{UID: 3, Elements: makeInput(inputs...), Out: pcol}
p, err := NewPlan("a", []Unit{a, pcol, in})
diff --git a/sdks/go/pkg/beam/core/runtime/exec/sdf.go b/sdks/go/pkg/beam/core/runtime/exec/sdf.go
index f1afade98f8..be4f491b04c 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/sdf.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/sdf.go
@@ -394,7 +394,7 @@ type ProcessSizedElementsAndRestrictions struct {
elm *FullValue // Currently processing element.
rt sdf.RTracker // Currently processing element's restriction tracker.
currW int // Index of the current window in elm being processed.
- initWeS interface{} // Initial state of the watermark estimator before processing elements.
+ initWeS any // Initial state of the watermark estimator before processing elements.
// Number of windows being processed. This number can differ from the number
// of windows in an element, indicating to only process a subset of windows.
@@ -630,8 +630,8 @@ type SplittableUnit interface {
// the singleWindowSplit and multiWindowSplit methods.
func (n *ProcessSizedElementsAndRestrictions) Split(f float64) ([]*FullValue, []*FullValue, error) {
// Get the watermark state immediately so that we don't overestimate our current watermark.
- var pWeState interface{}
- var rWeState interface{}
+ var pWeState any
+ var rWeState any
rWeState = n.wesInv.Invoke(n.PDo.we)
pWeState = rWeState
// If we've processed elements, the initial watermark estimator state will be set.
@@ -696,7 +696,7 @@ func (n *ProcessSizedElementsAndRestrictions) Checkpoint() ([]*FullValue, error)
// behavior is identical). A single restriction split will occur and all windows
// present in the unsplit element will be present in both the resulting primary
// and residual.
-func (n *ProcessSizedElementsAndRestrictions) singleWindowSplit(f float64, pWeState, rWeState interface{}) ([]*FullValue, []*FullValue, error) {
+func (n *ProcessSizedElementsAndRestrictions) singleWindowSplit(f float64, pWeState, rWeState any) ([]*FullValue, []*FullValue, error) {
if n.rt.IsDone() { // Not an error, but not splittable.
return []*FullValue{}, []*FullValue{}, nil
}
@@ -749,7 +749,7 @@ func (n *ProcessSizedElementsAndRestrictions) singleWindowSplit(f float64, pWeSt
//
// This method also updates the current number of windows (n.numW) so that
// windows in the residual will no longer be processed.
-func (n *ProcessSizedElementsAndRestrictions) multiWindowSplit(f float64, pWeState interface{}, rWeState interface{}) ([]*FullValue, []*FullValue, error) {
+func (n *ProcessSizedElementsAndRestrictions) multiWindowSplit(f float64, pWeState any, rWeState any) ([]*FullValue, []*FullValue, error) {
// Get the split point in window range, to see what window it falls in.
done, rem := n.rt.GetProgress()
cwp := done / (done + rem) // Progress in current window.
@@ -780,7 +780,7 @@ func (n *ProcessSizedElementsAndRestrictions) multiWindowSplit(f float64, pWeSta
// currentWindowSplit performs an appropriate split at the given fraction of
// remaining work in the current window. Also updates numW to stop after the
// current window.
-func (n *ProcessSizedElementsAndRestrictions) currentWindowSplit(f float64, pWeState interface{}, rWeState interface{}) ([]*FullValue, []*FullValue, error) {
+func (n *ProcessSizedElementsAndRestrictions) currentWindowSplit(f float64, pWeState any, rWeState any) ([]*FullValue, []*FullValue, error) {
p, r, err := n.rt.TrySplit(f)
if err != nil {
return nil, nil, err
@@ -827,7 +827,7 @@ func (n *ProcessSizedElementsAndRestrictions) currentWindowSplit(f float64, pWeS
// windowBoundarySplit performs an appropriate split at a window boundary. The
// split point taken should be the index of the first window in the residual.
// Also updates numW to stop at the split point.
-func (n *ProcessSizedElementsAndRestrictions) windowBoundarySplit(splitPt int, pWeState interface{}, rWeState interface{}) ([]*FullValue, []*FullValue, error) {
+func (n *ProcessSizedElementsAndRestrictions) windowBoundarySplit(splitPt int, pWeState any, rWeState any) ([]*FullValue, []*FullValue, error) {
// If this is at the boundary of the last window, split is a no-op.
if splitPt == n.numW {
return []*FullValue{}, []*FullValue{}, nil
@@ -849,7 +849,7 @@ func (n *ProcessSizedElementsAndRestrictions) windowBoundarySplit(splitPt int, p
// element restriction pair based on the currently processing element, but with
// a modified restriction and windows. Intended for creating primaries and
// residuals to return as split results.
-func (n *ProcessSizedElementsAndRestrictions) newSplitResult(rest interface{}, w []typex.Window, weState interface{}) (*FullValue, error) {
+func (n *ProcessSizedElementsAndRestrictions) newSplitResult(rest any, w []typex.Window, weState any) (*FullValue, error) {
var size float64
elm := n.elm.Elm.(*FullValue).Elm
if fv, ok := elm.(*FullValue); ok {
diff --git a/sdks/go/pkg/beam/core/runtime/exec/sdf_invokers.go b/sdks/go/pkg/beam/core/runtime/exec/sdf_invokers.go
index 079af1443cd..5d58f198a64 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/sdf_invokers.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/sdf_invokers.go
@@ -40,14 +40,14 @@ import (
// cirInvoker is an invoker for CreateInitialRestriction.
type cirInvoker struct {
fn *funcx.Fn
- args []interface{} // Cache to avoid allocating new slices per-element.
- call func(elms *FullValue) (rest interface{})
+ args []any // Cache to avoid allocating new slices per-element.
+ call func(elms *FullValue) (rest any)
}
func newCreateInitialRestrictionInvoker(fn *funcx.Fn) (*cirInvoker, error) {
n := &cirInvoker{
fn: fn,
- args: make([]interface{}, len(fn.Param)),
+ args: make([]any, len(fn.Param)),
}
if err := n.initCallFn(); err != nil {
return nil, errors.WithContext(err, "sdf CreateInitialRestriction invoker")
@@ -61,22 +61,22 @@ func (n *cirInvoker) initCallFn() error {
// TODO(BEAM-9643): Link to full documentation.
switch fnT := n.fn.Fn.(type) {
case reflectx.Func1x1:
- n.call = func(elms *FullValue) interface{} {
+ n.call = func(elms *FullValue) any {
return fnT.Call1x1(elms.Elm)
}
case reflectx.Func2x1:
- n.call = func(elms *FullValue) interface{} {
+ n.call = func(elms *FullValue) any {
return fnT.Call2x1(elms.Elm, elms.Elm2)
}
default:
switch len(n.fn.Param) {
case 1:
- n.call = func(elms *FullValue) interface{} {
+ n.call = func(elms *FullValue) any {
n.args[0] = elms.Elm
return n.fn.Fn.Call(n.args)[0]
}
case 2:
- n.call = func(elms *FullValue) interface{} {
+ n.call = func(elms *FullValue) any {
n.args[0] = elms.Elm
n.args[1] = elms.Elm2
return n.fn.Fn.Call(n.args)[0]
@@ -92,7 +92,7 @@ func (n *cirInvoker) initCallFn() error {
// Invoke calls CreateInitialRestriction with the given FullValue as the element
// and returns the resulting restriction.
-func (n *cirInvoker) Invoke(elms *FullValue) (rest interface{}) {
+func (n *cirInvoker) Invoke(elms *FullValue) (rest any) {
return n.call(elms)
}
@@ -107,14 +107,14 @@ func (n *cirInvoker) Reset() {
// srInvoker is an invoker for SplitRestriction.
type srInvoker struct {
fn *funcx.Fn
- args []interface{} // Cache to avoid allocating new slices per-element.
- call func(elms *FullValue, rest interface{}) (splits interface{})
+ args []any // Cache to avoid allocating new slices per-element.
+ call func(elms *FullValue, rest any) (splits any)
}
func newSplitRestrictionInvoker(fn *funcx.Fn) (*srInvoker, error) {
n := &srInvoker{
fn: fn,
- args: make([]interface{}, len(fn.Param)),
+ args: make([]any, len(fn.Param)),
}
if err := n.initCallFn(); err != nil {
return nil, errors.WithContext(err, "sdf SplitRestriction invoker")
@@ -128,23 +128,23 @@ func (n *srInvoker) initCallFn() error {
// TODO(BEAM-9643): Link to full documentation.
switch fnT := n.fn.Fn.(type) {
case reflectx.Func2x1:
- n.call = func(elms *FullValue, rest interface{}) interface{} {
+ n.call = func(elms *FullValue, rest any) any {
return fnT.Call2x1(elms.Elm, rest)
}
case reflectx.Func3x1:
- n.call = func(elms *FullValue, rest interface{}) interface{} {
+ n.call = func(elms *FullValue, rest any) any {
return fnT.Call3x1(elms.Elm, elms.Elm2, rest)
}
default:
switch len(n.fn.Param) {
case 2:
- n.call = func(elms *FullValue, rest interface{}) interface{} {
+ n.call = func(elms *FullValue, rest any) any {
n.args[0] = elms.Elm
n.args[1] = rest
return n.fn.Fn.Call(n.args)[0]
}
case 3:
- n.call = func(elms *FullValue, rest interface{}) interface{} {
+ n.call = func(elms *FullValue, rest any) any {
n.args[0] = elms.Elm
n.args[1] = elms.Elm2
n.args[2] = rest
@@ -160,12 +160,12 @@ func (n *srInvoker) initCallFn() error {
// Invoke calls SplitRestriction given a FullValue containing an element and
// the associated restriction, and returns a slice of split restrictions.
-func (n *srInvoker) Invoke(elms *FullValue, rest interface{}) (splits []interface{}) {
+func (n *srInvoker) Invoke(elms *FullValue, rest any) (splits []any) {
ret := n.call(elms, rest)
- // Return value is an interface{}, but we need to convert it to a []interface{}.
+ // Return value is an any, but we need to convert it to a []any.
val := reflect.ValueOf(ret)
- s := make([]interface{}, 0, val.Len())
+ s := make([]any, 0, val.Len())
for i := 0; i < val.Len(); i++ {
s = append(s, val.Index(i).Interface())
}
@@ -183,14 +183,14 @@ func (n *srInvoker) Reset() {
// rsInvoker is an invoker for RestrictionSize.
type rsInvoker struct {
fn *funcx.Fn
- args []interface{} // Cache to avoid allocating new slices per-element.
- call func(elms *FullValue, rest interface{}) (size float64)
+ args []any // Cache to avoid allocating new slices per-element.
+ call func(elms *FullValue, rest any) (size float64)
}
func newRestrictionSizeInvoker(fn *funcx.Fn) (*rsInvoker, error) {
n := &rsInvoker{
fn: fn,
- args: make([]interface{}, len(fn.Param)),
+ args: make([]any, len(fn.Param)),
}
if err := n.initCallFn(); err != nil {
return nil, errors.WithContext(err, "sdf RestrictionSize invoker")
@@ -204,23 +204,23 @@ func (n *rsInvoker) initCallFn() error {
// TODO(BEAM-9643): Link to full documentation.
switch fnT := n.fn.Fn.(type) {
case reflectx.Func2x1:
- n.call = func(elms *FullValue, rest interface{}) float64 {
+ n.call = func(elms *FullValue, rest any) float64 {
return fnT.Call2x1(elms.Elm, rest).(float64)
}
case reflectx.Func3x1:
- n.call = func(elms *FullValue, rest interface{}) float64 {
+ n.call = func(elms *FullValue, rest any) float64 {
return fnT.Call3x1(elms.Elm, elms.Elm2, rest).(float64)
}
default:
switch len(n.fn.Param) {
case 2:
- n.call = func(elms *FullValue, rest interface{}) float64 {
+ n.call = func(elms *FullValue, rest any) float64 {
n.args[0] = elms.Elm
n.args[1] = rest
return n.fn.Fn.Call(n.args)[0].(float64)
}
case 3:
- n.call = func(elms *FullValue, rest interface{}) float64 {
+ n.call = func(elms *FullValue, rest any) float64 {
n.args[0] = elms.Elm
n.args[1] = elms.Elm2
n.args[2] = rest
@@ -236,7 +236,7 @@ func (n *rsInvoker) initCallFn() error {
// Invoke calls RestrictionSize given a FullValue containing an element and
// the associated restriction, and returns a size.
-func (n *rsInvoker) Invoke(elms *FullValue, rest interface{}) (size float64) {
+func (n *rsInvoker) Invoke(elms *FullValue, rest any) (size float64) {
return n.call(elms, rest)
}
@@ -251,14 +251,14 @@ func (n *rsInvoker) Reset() {
// ctInvoker is an invoker for CreateTracker.
type ctInvoker struct {
fn *funcx.Fn
- args []interface{} // Cache to avoid allocating new slices per-element.
- call func(rest interface{}) sdf.RTracker
+ args []any // Cache to avoid allocating new slices per-element.
+ call func(rest any) sdf.RTracker
}
func newCreateTrackerInvoker(fn *funcx.Fn) (*ctInvoker, error) {
n := &ctInvoker{
fn: fn,
- args: make([]interface{}, len(fn.Param)),
+ args: make([]any, len(fn.Param)),
}
if err := n.initCallFn(); err != nil {
return nil, errors.WithContext(err, "sdf CreateTracker invoker")
@@ -272,7 +272,7 @@ func (n *ctInvoker) initCallFn() error {
// TODO(BEAM-9643): Link to full documentation.
switch fnT := n.fn.Fn.(type) {
case reflectx.Func1x1:
- n.call = func(rest interface{}) sdf.RTracker {
+ n.call = func(rest any) sdf.RTracker {
return fnT.Call1x1(rest).(sdf.RTracker)
}
default:
@@ -280,7 +280,7 @@ func (n *ctInvoker) initCallFn() error {
return errors.Errorf("CreateTracker fn %v has unexpected number of parameters: %v",
n.fn.Fn.Name(), len(n.fn.Param))
}
- n.call = func(rest interface{}) sdf.RTracker {
+ n.call = func(rest any) sdf.RTracker {
n.args[0] = rest
return n.fn.Fn.Call(n.args)[0].(sdf.RTracker)
}
@@ -289,7 +289,7 @@ func (n *ctInvoker) initCallFn() error {
}
// Invoke calls CreateTracker given a restriction and returns an sdf.RTracker.
-func (n *ctInvoker) Invoke(rest interface{}) sdf.RTracker {
+func (n *ctInvoker) Invoke(rest any) sdf.RTracker {
return n.call(rest)
}
@@ -304,11 +304,11 @@ func (n *ctInvoker) Reset() {
// trInvoker is an invoker for TruncateRestriction.
type trInvoker struct {
fn *funcx.Fn
- args []interface{}
- call func(rest interface{}, elms *FullValue) (pair interface{})
+ args []any
+ call func(rest any, elms *FullValue) (pair any)
}
-func defaultTruncateRestriction(restTracker interface{}) (newRest interface{}) {
+func defaultTruncateRestriction(restTracker any) (newRest any) {
if tracker, ok := restTracker.(sdf.BoundableRTracker); ok && !tracker.IsBounded() {
return nil
}
@@ -318,7 +318,7 @@ func defaultTruncateRestriction(restTracker interface{}) (newRest interface{}) {
func newTruncateRestrictionInvoker(fn *funcx.Fn) (*trInvoker, error) {
n := &trInvoker{
fn: fn,
- args: make([]interface{}, len(fn.Param)),
+ args: make([]any, len(fn.Param)),
}
if err := n.initCallFn(); err != nil {
return nil, errors.WithContext(err, "sdf TruncateRestriction invoker")
@@ -328,7 +328,7 @@ func newTruncateRestrictionInvoker(fn *funcx.Fn) (*trInvoker, error) {
func newDefaultTruncateRestrictionInvoker() (*trInvoker, error) {
n := &trInvoker{}
- n.call = func(rest interface{}, elms *FullValue) interface{} {
+ n.call = func(rest any, elms *FullValue) any {
return defaultTruncateRestriction(rest)
}
return n, nil
@@ -340,23 +340,23 @@ func (n *trInvoker) initCallFn() error {
// TODO(BEAM-9643): Link to full documentation.
switch fnT := n.fn.Fn.(type) {
case reflectx.Func2x1:
- n.call = func(rest interface{}, elms *FullValue) interface{} {
+ n.call = func(rest any, elms *FullValue) any {
return fnT.Call2x1(rest, elms.Elm)
}
case reflectx.Func3x1:
- n.call = func(rest interface{}, elms *FullValue) interface{} {
+ n.call = func(rest any, elms *FullValue) any {
return fnT.Call3x1(rest, elms.Elm, elms.Elm2)
}
default:
switch len(n.fn.Param) {
case 2:
- n.call = func(rest interface{}, elms *FullValue) interface{} {
+ n.call = func(rest any, elms *FullValue) any {
n.args[0] = rest
n.args[1] = elms.Elm
return n.fn.Fn.Call(n.args)[0]
}
case 3:
- n.call = func(rest interface{}, elms *FullValue) interface{} {
+ n.call = func(rest any, elms *FullValue) any {
n.args[0] = rest
n.args[1] = elms.Elm
n.args[2] = elms.Elm2
@@ -372,7 +372,7 @@ func (n *trInvoker) initCallFn() error {
// Invoke calls TruncateRestriction given a FullValue containing an element and
// the associated restriction tracker, and returns a truncated restriction.
-func (n *trInvoker) Invoke(rt interface{}, elms *FullValue) (rest interface{}) {
+func (n *trInvoker) Invoke(rt any, elms *FullValue) (rest any) {
return n.call(rt, elms)
}
@@ -387,14 +387,14 @@ func (n *trInvoker) Reset() {
// cweInvoker is an invoker for CreateWatermarkEstimator.
type cweInvoker struct {
fn *funcx.Fn
- args []interface{} // Cache to avoid allocating new slices per-element.
- call func(rest interface{}) sdf.WatermarkEstimator
+ args []any // Cache to avoid allocating new slices per-element.
+ call func(rest any) sdf.WatermarkEstimator
}
func newCreateWatermarkEstimatorInvoker(fn *funcx.Fn) (*cweInvoker, error) {
n := &cweInvoker{
fn: fn,
- args: make([]interface{}, len(fn.Param)),
+ args: make([]any, len(fn.Param)),
}
if err := n.initCallFn(); err != nil {
return nil, errors.WithContext(err, "sdf CreateWatermarkEstimator invoker")
@@ -407,21 +407,21 @@ func (n *cweInvoker) initCallFn() error {
// (watermarkState?) sdf.WatermarkEstimator
switch fnT := n.fn.Fn.(type) {
case reflectx.Func0x1:
- n.call = func(rest interface{}) sdf.WatermarkEstimator {
+ n.call = func(rest any) sdf.WatermarkEstimator {
return fnT.Call0x1().(sdf.WatermarkEstimator)
}
case reflectx.Func1x1:
- n.call = func(rest interface{}) sdf.WatermarkEstimator {
+ n.call = func(rest any) sdf.WatermarkEstimator {
return fnT.Call1x1(rest).(sdf.WatermarkEstimator)
}
default:
switch len(n.fn.Param) {
case 0:
- n.call = func(rest interface{}) sdf.WatermarkEstimator {
+ n.call = func(rest any) sdf.WatermarkEstimator {
return n.fn.Fn.Call(n.args)[0].(sdf.WatermarkEstimator)
}
case 1:
- n.call = func(rest interface{}) sdf.WatermarkEstimator {
+ n.call = func(rest any) sdf.WatermarkEstimator {
n.args[0] = rest
return n.fn.Fn.Call(n.args)[0].(sdf.WatermarkEstimator)
}
@@ -434,7 +434,7 @@ func (n *cweInvoker) initCallFn() error {
}
// Invoke calls CreateWatermarkEstimator given a restriction and returns an sdf.WatermarkEstimator.
-func (n *cweInvoker) Invoke(rest interface{}) sdf.WatermarkEstimator {
+func (n *cweInvoker) Invoke(rest any) sdf.WatermarkEstimator {
return n.call(rest)
}
@@ -449,14 +449,14 @@ func (n *cweInvoker) Reset() {
// iwesInvoker is an invoker for InitialWatermarkEstimatorState.
type iwesInvoker struct {
fn *funcx.Fn
- args []interface{} // Cache to avoid allocating new slices per-element.
- call func(rest interface{}, elms *FullValue) interface{}
+ args []any // Cache to avoid allocating new slices per-element.
+ call func(rest any, elms *FullValue) any
}
func newInitialWatermarkEstimatorStateInvoker(fn *funcx.Fn) (*iwesInvoker, error) {
- args := []interface{}{}
+ args := []any{}
if fn != nil {
- args = make([]interface{}, len(fn.Param))
+ args = make([]any, len(fn.Param))
}
n := &iwesInvoker{
fn: fn,
@@ -471,33 +471,33 @@ func newInitialWatermarkEstimatorStateInvoker(fn *funcx.Fn) (*iwesInvoker, error
func (n *iwesInvoker) initCallFn() error {
// If no WatermarkEstimatorState function is defined, we'll use a default implementation that just returns false as the state.
if n.fn == nil {
- n.call = func(rest interface{}, elms *FullValue) interface{} {
+ n.call = func(rest any, elms *FullValue) any {
return false
}
return nil
}
// Expects a signature of the form:
- // (typex.EventTime, restrictionTracker, key?, value) interface{}
+ // (typex.EventTime, restrictionTracker, key?, value) any
switch fnT := n.fn.Fn.(type) {
case reflectx.Func3x1:
- n.call = func(rest interface{}, elms *FullValue) interface{} {
+ n.call = func(rest any, elms *FullValue) any {
return fnT.Call3x1(elms.Timestamp, rest, elms.Elm)
}
case reflectx.Func4x1:
- n.call = func(rest interface{}, elms *FullValue) interface{} {
+ n.call = func(rest any, elms *FullValue) any {
return fnT.Call4x1(elms.Timestamp, rest, elms.Elm, elms.Elm2)
}
default:
switch len(n.fn.Param) {
case 3:
- n.call = func(rest interface{}, elms *FullValue) interface{} {
+ n.call = func(rest any, elms *FullValue) any {
n.args[0] = elms.Timestamp
n.args[1] = rest
n.args[2] = elms.Elm
return n.fn.Fn.Call(n.args)[0]
}
case 4:
- n.call = func(rest interface{}, elms *FullValue) interface{} {
+ n.call = func(rest any, elms *FullValue) any {
n.args[0] = elms.Timestamp
n.args[1] = rest
n.args[2] = elms.Elm
@@ -513,7 +513,7 @@ func (n *iwesInvoker) initCallFn() error {
}
// Invoke calls InitialWatermarkEstimatorState given a restriction and returns an sdf.RTracker.
-func (n *iwesInvoker) Invoke(rest interface{}, elms *FullValue) interface{} {
+func (n *iwesInvoker) Invoke(rest any, elms *FullValue) any {
return n.call(rest, elms)
}
@@ -528,14 +528,14 @@ func (n *iwesInvoker) Reset() {
// wesInvoker is an invoker for WatermarkEstimatorState.
type wesInvoker struct {
fn *funcx.Fn
- args []interface{} // Cache to avoid allocating new slices per-element.
- call func(we sdf.WatermarkEstimator) interface{}
+ args []any // Cache to avoid allocating new slices per-element.
+ call func(we sdf.WatermarkEstimator) any
}
func newWatermarkEstimatorStateInvoker(fn *funcx.Fn) (*wesInvoker, error) {
- args := []interface{}{}
+ args := []any{}
if fn != nil {
- args = make([]interface{}, len(fn.Param))
+ args = make([]any, len(fn.Param))
}
n := &wesInvoker{
fn: fn,
@@ -550,7 +550,7 @@ func newWatermarkEstimatorStateInvoker(fn *funcx.Fn) (*wesInvoker, error) {
func (n *wesInvoker) initCallFn() error {
// If no WatermarkEstimatorState function is defined, we'll use a default implementation that just returns false as the state.
if n.fn == nil {
- n.call = func(we sdf.WatermarkEstimator) interface{} {
+ n.call = func(we sdf.WatermarkEstimator) any {
return false
}
return nil
@@ -559,13 +559,13 @@ func (n *wesInvoker) initCallFn() error {
// (state) sdf.WatermarkEstimator
switch fnT := n.fn.Fn.(type) {
case reflectx.Func1x1:
- n.call = func(we sdf.WatermarkEstimator) interface{} {
+ n.call = func(we sdf.WatermarkEstimator) any {
return fnT.Call1x1(we)
}
default:
switch len(n.fn.Param) {
case 1:
- n.call = func(we sdf.WatermarkEstimator) interface{} {
+ n.call = func(we sdf.WatermarkEstimator) any {
n.args[0] = we
return n.fn.Fn.Call(n.args)[0]
}
@@ -578,7 +578,7 @@ func (n *wesInvoker) initCallFn() error {
}
// Invoke calls WatermarkEstimatorState given a restriction and returns an sdf.RTracker.
-func (n *wesInvoker) Invoke(we sdf.WatermarkEstimator) interface{} {
+func (n *wesInvoker) Invoke(we sdf.WatermarkEstimator) any {
return n.call(we)
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/sdf_invokers_test.go b/sdks/go/pkg/beam/core/runtime/exec/sdf_invokers_test.go
index e68dc71eb88..e308071aaf9 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/sdf_invokers_test.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/sdf_invokers_test.go
@@ -98,14 +98,14 @@ func TestInvokes(t *testing.T) {
sdf *graph.SplittableDoFn
elms *FullValue
rest *VetRestriction
- want []interface{}
+ want []any
}{
{
name: "SingleElem",
sdf: sdf,
elms: &FullValue{Elm: 1},
rest: &VetRestriction{ID: "Sdf"},
- want: []interface{}{
+ want: []any{
&VetRestriction{ID: "Sdf.1", SplitRest: true, Val: 1},
&VetRestriction{ID: "Sdf.2", SplitRest: true, Val: 1},
},
@@ -114,7 +114,7 @@ func TestInvokes(t *testing.T) {
sdf: kvsdf,
elms: &FullValue{Elm: 1, Elm2: 2},
rest: &VetRestriction{ID: "KvSdf"},
- want: []interface{}{
+ want: []any{
&VetRestriction{ID: "KvSdf.1", SplitRest: true, Key: 1, Val: 2},
&VetRestriction{ID: "KvSdf.2", SplitRest: true, Key: 1, Val: 2},
},
@@ -314,7 +314,7 @@ func TestInvokes(t *testing.T) {
sdf *graph.SplittableDoFn
elms *FullValue
rest *VetRestriction
- want interface{}
+ want any
}{
{
name: "SingleElem",
@@ -374,7 +374,7 @@ func TestInvokes(t *testing.T) {
sdf *graph.SplittableDoFn
elms *FullValue
rest *VetRestriction
- want interface{}
+ want any
}{
{
name: "SingleElem",
@@ -456,7 +456,7 @@ type VetRestriction struct {
// Key and Val just copy the last seen input element's key and value to
// confirm that the restriction saw the expected element.
- Key, Val interface{}
+ Key, Val any
// Bounded just tells if the restriction is bounded or not
Bounded bool
@@ -476,12 +476,12 @@ type VetRTracker struct {
Rest *VetRestriction
}
-func (rt *VetRTracker) TryClaim(interface{}) bool { return false }
+func (rt *VetRTracker) TryClaim(any) bool { return false }
func (rt *VetRTracker) GetError() error { return nil }
func (rt *VetRTracker) GetProgress() (float64, float64) { return 0, 0 }
func (rt *VetRTracker) IsDone() bool { return true }
-func (rt *VetRTracker) GetRestriction() interface{} { return nil }
-func (rt *VetRTracker) TrySplit(_ float64) (interface{}, interface{}, error) {
+func (rt *VetRTracker) GetRestriction() any { return nil }
+func (rt *VetRTracker) TrySplit(_ float64) (any, any, error) {
return nil, nil, nil
}
func (rt *VetRTracker) IsBounded() bool { return rt.Rest.Bounded }
diff --git a/sdks/go/pkg/beam/core/runtime/exec/sdf_test.go b/sdks/go/pkg/beam/core/runtime/exec/sdf_test.go
index 278ab07c8f6..6520b9dfe59 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/sdf_test.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/sdf_test.go
@@ -1536,7 +1536,7 @@ func (rt *SplittableUnitRTracker) IsDone() bool {
return rt.ThisIsDone
}
-func (rt *SplittableUnitRTracker) TrySplit(_ float64) (interface{}, interface{}, error) {
+func (rt *SplittableUnitRTracker) TrySplit(_ float64) (any, any, error) {
rest1 := rt.Rest.copy()
rest1.ID += ".1"
rest2 := rt.Rest.copy()
@@ -1560,7 +1560,7 @@ func (rt *SplittableUnitCheckpointingRTracker) IsDone() bool {
return rt.isDone
}
-func (rt *SplittableUnitCheckpointingRTracker) TrySplit(_ float64) (interface{}, interface{}, error) {
+func (rt *SplittableUnitCheckpointingRTracker) TrySplit(_ float64) (any, any, error) {
rest1 := rt.Rest.copy()
rest1.ID += ".1"
rest2 := rt.Rest.copy()
diff --git a/sdks/go/pkg/beam/core/runtime/exec/sideinput.go b/sdks/go/pkg/beam/core/runtime/exec/sideinput.go
index 8cba99c4a51..1af4e71689b 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/sideinput.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/sideinput.go
@@ -33,7 +33,7 @@ const iterableSideInputKey = ""
// encapsulates StreamID and coding as needed.
type SideInputAdapter interface {
NewIterable(ctx context.Context, reader StateReader, w typex.Window) (ReStream, error)
- NewKeyedIterable(ctx context.Context, reader StateReader, w typex.Window, iterKey interface{}) (ReStream, error)
+ NewKeyedIterable(ctx context.Context, reader StateReader, w typex.Window, iterKey any) (ReStream, error)
}
type sideInputAdapter struct {
@@ -104,7 +104,7 @@ func (s *sideInputAdapter) NewIterable(ctx context.Context, reader StateReader,
// NewKeyedIterable returns a ReStream of a multimap side input from the runner, either by getting the ReStream from
// the side input cache or by opening a new stream and reading it in.
-func (s *sideInputAdapter) NewKeyedIterable(ctx context.Context, reader StateReader, w typex.Window, iterKey interface{}) (ReStream, error) {
+func (s *sideInputAdapter) NewKeyedIterable(ctx context.Context, reader StateReader, w typex.Window, iterKey any) (ReStream, error) {
if s.kc == nil {
return nil, fmt.Errorf("cannot make a keyed iterable for an unkeyed side input %v", s.sideInputID)
}
@@ -172,7 +172,7 @@ type FixedKey struct {
// UID is the unit identifier.
UID UnitID
// Key is the given key
- Key interface{}
+ Key any
// Out is the successor node.
Out Node
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/unit_test.go b/sdks/go/pkg/beam/core/runtime/exec/unit_test.go
index efb9edcdbce..9d0137a0edd 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/unit_test.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/unit_test.go
@@ -163,7 +163,7 @@ func (a *FixedSideInputAdapter) NewIterable(ctx context.Context, reader StateRea
return a.Val, nil
}
-func (a *FixedSideInputAdapter) NewKeyedIterable(ctx context.Context, reader StateReader, w typex.Window, iterKey interface{}) (ReStream, error) {
+func (a *FixedSideInputAdapter) NewKeyedIterable(ctx context.Context, reader StateReader, w typex.Window, iterKey any) (ReStream, error) {
return a.Val, nil
}
diff --git a/sdks/go/pkg/beam/core/runtime/exec/userstate.go b/sdks/go/pkg/beam/core/runtime/exec/userstate.go
index b946e67b63d..f83aee4bf74 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/userstate.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/userstate.go
@@ -36,10 +36,10 @@ type stateProvider struct {
window []byte
transactionsByKey map[string][]state.Transaction
- initialValueByKey map[string]interface{}
- initialBagByKey map[string][]interface{}
- initialMapValuesByKey map[string]map[string]interface{}
- initialMapKeysByKey map[string][]interface{}
+ initialValueByKey map[string]any
+ initialBagByKey map[string][]any
+ initialMapValuesByKey map[string]map[string]any
+ initialMapKeysByKey map[string][]any
readersByKey map[string]io.ReadCloser
appendersByKey map[string]io.Writer
clearersByKey map[string]io.Writer
@@ -49,7 +49,7 @@ type stateProvider struct {
}
// ReadValueState reads a value state from the State API
-func (s *stateProvider) ReadValueState(userStateID string) (interface{}, []state.Transaction, error) {
+func (s *stateProvider) ReadValueState(userStateID string) (any, []state.Transaction, error) {
initialValue, ok := s.initialValueByKey[userStateID]
if !ok {
rw, err := s.getBagReader(userStateID)
@@ -123,10 +123,10 @@ func (s *stateProvider) ClearValueState(val state.Transaction) error {
}
// ReadBagState reads a bag state from the State API
-func (s *stateProvider) ReadBagState(userStateID string) ([]interface{}, []state.Transaction, error) {
+func (s *stateProvider) ReadBagState(userStateID string) ([]any, []state.Transaction, error) {
initialValue, ok := s.initialBagByKey[userStateID]
if !ok {
- initialValue = []interface{}{}
+ initialValue = []any{}
rw, err := s.getBagReader(userStateID)
if err != nil {
return nil, nil, err
@@ -193,10 +193,10 @@ func (s *stateProvider) WriteBagState(val state.Transaction) error {
}
// ReadMapStateValue reads a value from the map state for a given key.
-func (s *stateProvider) ReadMapStateValue(userStateID string, key interface{}) (interface{}, []state.Transaction, error) {
+func (s *stateProvider) ReadMapStateValue(userStateID string, key any) (any, []state.Transaction, error) {
_, ok := s.initialMapValuesByKey[userStateID]
if !ok {
- s.initialMapValuesByKey[userStateID] = make(map[string]interface{})
+ s.initialMapValuesByKey[userStateID] = make(map[string]any)
}
b, err := s.encodeKey(userStateID, key)
if err != nil {
@@ -229,10 +229,10 @@ func (s *stateProvider) ReadMapStateValue(userStateID string, key interface{}) (
}
// ReadMapStateKeys reads all the keys in a map state.
-func (s *stateProvider) ReadMapStateKeys(userStateID string) ([]interface{}, []state.Transaction, error) {
+func (s *stateProvider) ReadMapStateKeys(userStateID string) ([]any, []state.Transaction, error) {
initialValue, ok := s.initialMapKeysByKey[userStateID]
if !ok {
- initialValue = []interface{}{}
+ initialValue = []any{}
rw, err := s.getMultiMapKeyReader(userStateID)
if err != nil {
return nil, nil, err
@@ -398,7 +398,7 @@ func (s *stateProvider) getBagClearer(userStateID string) (io.Writer, error) {
return s.clearersByKey[userStateID], nil
}
-func (s *stateProvider) getMultiMapReader(userStateID string, key interface{}) (io.ReadCloser, error) {
+func (s *stateProvider) getMultiMapReader(userStateID string, key any) (io.ReadCloser, error) {
ek, err := s.encodeKey(userStateID, key)
if err != nil {
return nil, err
@@ -410,7 +410,7 @@ func (s *stateProvider) getMultiMapReader(userStateID string, key interface{}) (
return r, nil
}
-func (s *stateProvider) getMultiMapAppender(userStateID string, key interface{}) (io.Writer, error) {
+func (s *stateProvider) getMultiMapAppender(userStateID string, key any) (io.Writer, error) {
ek, err := s.encodeKey(userStateID, key)
if err != nil {
return nil, err
@@ -422,7 +422,7 @@ func (s *stateProvider) getMultiMapAppender(userStateID string, key interface{})
return w, nil
}
-func (s *stateProvider) getMultiMapKeyClearer(userStateID string, key interface{}) (io.Writer, error) {
+func (s *stateProvider) getMultiMapKeyClearer(userStateID string, key any) (io.Writer, error) {
ek, err := s.encodeKey(userStateID, key)
if err != nil {
return nil, err
@@ -454,7 +454,7 @@ func (s *stateProvider) getMultiMapKeyReader(userStateID string) (io.ReadCloser,
return s.readersByKey[userStateID], nil
}
-func (s *stateProvider) encodeKey(userStateID string, key interface{}) ([]byte, error) {
+func (s *stateProvider) encodeKey(userStateID string, key any) ([]byte, error) {
fv := FullValue{Elm: key}
enc := MakeElementEncoder(coder.SkipW(s.keyCodersByID[userStateID]))
var b bytes.Buffer
@@ -467,7 +467,7 @@ func (s *stateProvider) encodeKey(userStateID string, key interface{}) ([]byte,
// UserStateAdapter provides a state provider to be used for user state.
type UserStateAdapter interface {
- NewStateProvider(ctx context.Context, reader StateReader, w typex.Window, element interface{}) (stateProvider, error)
+ NewStateProvider(ctx context.Context, reader StateReader, w typex.Window, element any) (stateProvider, error)
}
type userStateAdapter struct {
@@ -496,7 +496,7 @@ func NewUserStateAdapter(sid StreamID, c *coder.Coder, stateIDToCoder map[string
}
// NewStateProvider creates a stateProvider with the ability to talk to the state API.
-func (s *userStateAdapter) NewStateProvider(ctx context.Context, reader StateReader, w typex.Window, element interface{}) (stateProvider, error) {
+func (s *userStateAdapter) NewStateProvider(ctx context.Context, reader StateReader, w typex.Window, element any) (stateProvider, error) {
if s.kc == nil {
return stateProvider{}, fmt.Errorf("cannot make a state provider for an unkeyed input %v", element)
}
@@ -516,10 +516,10 @@ func (s *userStateAdapter) NewStateProvider(ctx context.Context, reader StateRea
elementKey: elementKey,
window: win,
transactionsByKey: make(map[string][]state.Transaction),
- initialValueByKey: make(map[string]interface{}),
- initialBagByKey: make(map[string][]interface{}),
- initialMapValuesByKey: make(map[string]map[string]interface{}),
- initialMapKeysByKey: make(map[string][]interface{}),
+ initialValueByKey: make(map[string]any),
+ initialBagByKey: make(map[string][]any),
+ initialMapValuesByKey: make(map[string]map[string]any),
+ initialMapKeysByKey: make(map[string][]any),
readersByKey: make(map[string]io.ReadCloser),
appendersByKey: make(map[string]io.Writer),
clearersByKey: make(map[string]io.Writer),
diff --git a/sdks/go/pkg/beam/core/runtime/exec/userstate_test.go b/sdks/go/pkg/beam/core/runtime/exec/userstate_test.go
index 7efb703b622..9220e04f66e 100644
--- a/sdks/go/pkg/beam/core/runtime/exec/userstate_test.go
+++ b/sdks/go/pkg/beam/core/runtime/exec/userstate_test.go
@@ -39,7 +39,7 @@ func TestReadValueState(t *testing.T) {
name string
stateID string
coder *coder.Coder
- ret interface{}
+ ret any
err bool
}{
{
@@ -82,8 +82,8 @@ func buildStateProvider() stateProvider {
elementKey: []byte{1},
window: []byte{1},
transactionsByKey: make(map[string][]state.Transaction),
- initialValueByKey: make(map[string]interface{}),
- initialBagByKey: make(map[string][]interface{}),
+ initialValueByKey: make(map[string]any),
+ initialBagByKey: make(map[string][]any),
readersByKey: make(map[string]io.ReadCloser),
appendersByKey: make(map[string]io.Writer),
clearersByKey: make(map[string]io.Writer),
diff --git a/sdks/go/pkg/beam/core/runtime/genx/genx.go b/sdks/go/pkg/beam/core/runtime/genx/genx.go
index 19f9e7acbc2..d78ef35b8ac 100644
--- a/sdks/go/pkg/beam/core/runtime/genx/genx.go
+++ b/sdks/go/pkg/beam/core/runtime/genx/genx.go
@@ -36,7 +36,7 @@ import (
// and registers those types for you.
//
// Panics if not passed a dofn.
-func RegisterDoFn(dofn interface{}) {
+func RegisterDoFn(dofn any) {
f, ts, err := registerDoFn(dofn)
if err != nil {
panic(err)
@@ -54,7 +54,7 @@ func RegisterDoFn(dofn interface{}) {
// register with runtime.RegisterFunction.
// The second return is all types to register with runtime.RegisterType.
// Returns an error if the passed in values are not DoFns.
-func registerDoFn(dofn interface{}) (interface{}, []reflect.Type, error) {
+func registerDoFn(dofn any) (any, []reflect.Type, error) {
if rt, ok := dofn.(reflect.Type); ok {
if rt.Kind() == reflect.Ptr {
rt = rt.Elem()
@@ -81,7 +81,7 @@ func registerDoFn(dofn interface{}) (interface{}, []reflect.Type, error) {
return nil, nil, err
}
- var retFunc interface{}
+ var retFunc any
rt := reflect.TypeOf(dofn)
switch rt.Kind() {
case reflect.Func:
diff --git a/sdks/go/pkg/beam/core/runtime/genx/genx_test.go b/sdks/go/pkg/beam/core/runtime/genx/genx_test.go
index 17b69038157..0dced3f4807 100644
--- a/sdks/go/pkg/beam/core/runtime/genx/genx_test.go
+++ b/sdks/go/pkg/beam/core/runtime/genx/genx_test.go
@@ -48,7 +48,7 @@ func TestRegisterDoFn(t *testing.T) {
tests := []struct {
name string
- dofn interface{}
+ dofn any
ok bool // is this a valid dofn?
isFunc bool // is this a functional dofn?
types []reflect.Type // expected types
diff --git a/sdks/go/pkg/beam/core/runtime/graphx/serialize.go b/sdks/go/pkg/beam/core/runtime/graphx/serialize.go
index 4fe1a9e1616..b41aa2acc9b 100644
--- a/sdks/go/pkg/beam/core/runtime/graphx/serialize.go
+++ b/sdks/go/pkg/beam/core/runtime/graphx/serialize.go
@@ -326,7 +326,7 @@ func encodeUserFn(u *funcx.Fn) (*v1pb.UserFn, error) {
// decodeUserFn receives the wire representation of a Beam user function,
// extracting the preprocessed representation, expanding all inputs and outputs
// of the function.
-func decodeUserFn(ref *v1pb.UserFn) (interface{}, error) {
+func decodeUserFn(ref *v1pb.UserFn) (any, error) {
t, err := decodeType(ref.GetType())
if err != nil {
return nil, err
diff --git a/sdks/go/pkg/beam/core/runtime/graphx/translate_test.go b/sdks/go/pkg/beam/core/runtime/graphx/translate_test.go
index dec418154c5..2836351f266 100644
--- a/sdks/go/pkg/beam/core/runtime/graphx/translate_test.go
+++ b/sdks/go/pkg/beam/core/runtime/graphx/translate_test.go
@@ -58,7 +58,7 @@ func pickSideFn(a, side int, small, big func(int)) {
}
}
-func addDoFn(t *testing.T, g *graph.Graph, fn interface{}, scope *graph.Scope, inputs []*graph.Node, outputCoders []*coder.Coder, rc *coder.Coder) {
+func addDoFn(t *testing.T, g *graph.Graph, fn any, scope *graph.Scope, inputs []*graph.Node, outputCoders []*coder.Coder, rc *coder.Coder) {
t.Helper()
dofn, err := graph.NewDoFn(fn)
if err != nil {
@@ -196,13 +196,13 @@ func TestMarshal(t *testing.T) {
type testRT struct {
}
-func (rt *testRT) TryClaim(_ interface{}) bool { return false }
+func (rt *testRT) TryClaim(_ any) bool { return false }
func (rt *testRT) GetError() error { return nil }
func (rt *testRT) GetProgress() (float64, float64) { return 0, 0 }
func (rt *testRT) IsDone() bool { return true }
-func (rt *testRT) GetRestriction() interface{} { return nil }
+func (rt *testRT) GetRestriction() any { return nil }
func (rt *testRT) IsBounded() bool { return true }
-func (rt *testRT) TrySplit(_ float64) (interface{}, interface{}, error) {
+func (rt *testRT) TrySplit(_ float64) (any, any, error) {
return nil, nil, nil
}
diff --git a/sdks/go/pkg/beam/core/runtime/graphx/user_test.go b/sdks/go/pkg/beam/core/runtime/graphx/user_test.go
index 33c78570f9e..b743178ed49 100644
--- a/sdks/go/pkg/beam/core/runtime/graphx/user_test.go
+++ b/sdks/go/pkg/beam/core/runtime/graphx/user_test.go
@@ -85,7 +85,7 @@ func argAndRet(x string) string { return x }
func TestEncodeDecodeFn(t *testing.T) {
var tests = []struct {
name string
- inFn interface{}
+ inFn any
}{
{
"no arg or return",
diff --git a/sdks/go/pkg/beam/core/runtime/graphx/xlang.go b/sdks/go/pkg/beam/core/runtime/graphx/xlang.go
index fbf808751be..baee3c00093 100644
--- a/sdks/go/pkg/beam/core/runtime/graphx/xlang.go
+++ b/sdks/go/pkg/beam/core/runtime/graphx/xlang.go
@@ -232,7 +232,7 @@ func RemoveFakeImpulses(c *pipepb.Components, ext *pipepb.PTransform) {
}
}
-// ExpandedComponents type asserts the Components field with interface{} type
+// ExpandedComponents type asserts the Components field with any type
// and returns its pipeline component proto representation
func ExpandedComponents(exp *graph.ExpandedTransform) (*pipepb.Components, error) {
if c, ok := exp.Components.(*pipepb.Components); ok {
@@ -241,7 +241,7 @@ func ExpandedComponents(exp *graph.ExpandedTransform) (*pipepb.Components, error
return nil, errors.Errorf("malformed components; %v lacks a conforming pipeline component", exp)
}
-// ExpandedTransform type asserts the Transform field with interface{} type
+// ExpandedTransform type asserts the Transform field with any type
// and returns its pipeline ptransform proto representation
func ExpandedTransform(exp *graph.ExpandedTransform) (*pipepb.PTransform, error) {
if t, ok := exp.Transform.(*pipepb.PTransform); ok {
diff --git a/sdks/go/pkg/beam/core/runtime/harness/harness.go b/sdks/go/pkg/beam/core/runtime/harness/harness.go
index 95c1729166b..710566d115a 100644
--- a/sdks/go/pkg/beam/core/runtime/harness/harness.go
+++ b/sdks/go/pkg/beam/core/runtime/harness/harness.go
@@ -329,7 +329,7 @@ func (c *control) getOrCreatePlan(bdID bundleDescriptorID) (*exec.Plan, error) {
desc, ok := c.descriptors[bdID]
c.mu.Unlock() // Unlock to make the lookup or build the descriptor.
if !ok {
- newDesc, err, _ := c.bundleGetGroup.Do(string(bdID), func() (interface{}, error) {
+ newDesc, err, _ := c.bundleGetGroup.Do(string(bdID), func() (any, error) {
newDesc, err := c.lookupDesc(bdID)
if err != nil {
return nil, errors.WithContextf(err, "execution plan for %v not found", bdID)
@@ -681,7 +681,7 @@ func (c *control) getPlanOrResponse(ctx context.Context, kind string, instID, re
return plan, store, nil
}
-func fail(ctx context.Context, id instructionID, format string, args ...interface{}) *fnpb.InstructionResponse {
+func fail(ctx context.Context, id instructionID, format string, args ...any) *fnpb.InstructionResponse {
log.Output(ctx, log.SevError, 1, fmt.Sprintf(format, args...))
dummy := &fnpb.InstructionResponse_Register{Register: &fnpb.RegisterResponse{}}
diff --git a/sdks/go/pkg/beam/core/runtime/harness/session.go b/sdks/go/pkg/beam/core/runtime/harness/session.go
index 390821cb32a..a72528024d5 100644
--- a/sdks/go/pkg/beam/core/runtime/harness/session.go
+++ b/sdks/go/pkg/beam/core/runtime/harness/session.go
@@ -35,7 +35,7 @@ var capture io.WriteCloser
var (
sessionLock sync.Mutex
bufPool = sync.Pool{
- New: func() interface{} {
+ New: func() any {
return proto.NewBuffer(nil)
},
}
diff --git a/sdks/go/pkg/beam/core/runtime/harness/statecache/statecache_test.go b/sdks/go/pkg/beam/core/runtime/harness/statecache/statecache_test.go
index 1e82fc42633..23f6fbf2461 100644
--- a/sdks/go/pkg/beam/core/runtime/harness/statecache/statecache_test.go
+++ b/sdks/go/pkg/beam/core/runtime/harness/statecache/statecache_test.go
@@ -23,12 +23,12 @@ import (
fnpb "github.com/apache/beam/sdks/v2/go/pkg/beam/model/fnexecution_v1"
)
-func makeTestReStream(value interface{}) exec.ReStream {
+func makeTestReStream(value any) exec.ReStream {
fv := exec.FullValue{Elm: value}
return &exec.FixedReStream{Buf: []exec.FullValue{fv}}
}
-func getValue(rs exec.ReStream) interface{} {
+func getValue(rs exec.ReStream) any {
stream, _ := rs.Open()
fullVal, _ := stream.Read()
return fullVal.Elm
diff --git a/sdks/go/pkg/beam/core/runtime/symbols.go b/sdks/go/pkg/beam/core/runtime/symbols.go
index 08e3de199c5..e8ff532e763 100644
--- a/sdks/go/pkg/beam/core/runtime/symbols.go
+++ b/sdks/go/pkg/beam/core/runtime/symbols.go
@@ -28,7 +28,7 @@ import (
var (
// Resolver is the accessible symbol resolver the runtime uses to find functions.
Resolver SymbolResolver
- cache = make(map[string]interface{})
+ cache = make(map[string]any)
mu sync.Mutex
)
@@ -73,7 +73,7 @@ type SymbolResolver interface {
// and is needed for functions -- such as custom coders -- serialized during unit
// tests, where the underlying symbol table is not available. It should be called
// in `init()` only.
-func RegisterFunction(fn interface{}) {
+func RegisterFunction(fn any) {
if initialized {
panic("Init hooks have already run. Register function during init() instead.")
}
@@ -85,7 +85,7 @@ func RegisterFunction(fn interface{}) {
// ResolveFunction resolves the runtime value of a given function by symbol name
// and type.
-func ResolveFunction(name string, t reflect.Type) (interface{}, error) {
+func ResolveFunction(name string, t reflect.Type) (any, error) {
mu.Lock()
defer mu.Unlock()
diff --git a/sdks/go/pkg/beam/core/runtime/xlangx/payload.go b/sdks/go/pkg/beam/core/runtime/xlangx/payload.go
index 0d208743176..959b3f659fc 100644
--- a/sdks/go/pkg/beam/core/runtime/xlangx/payload.go
+++ b/sdks/go/pkg/beam/core/runtime/xlangx/payload.go
@@ -30,7 +30,7 @@ import (
// ExternalConfigurationPayload proto, containing a Schema representation of
// the original type and the original value encoded as a Row. This is intended
// to be used as the expansion payload for an External transform.
-func EncodeStructPayload(pl interface{}) ([]byte, error) {
+func EncodeStructPayload(pl any) ([]byte, error) {
rt := reflect.TypeOf(pl)
// Encode payload value as a Row.
@@ -69,7 +69,7 @@ func EncodeStructPayload(pl interface{}) ([]byte, error) {
// DecodeStructPayload takes a marshaled ExternalConfigurationPayload proto
// and returns a native Go struct, with its type converted from the Schema
// representation and its value decoded from the Row.
-func DecodeStructPayload(plBytes []byte) (interface{}, error) {
+func DecodeStructPayload(plBytes []byte) (any, error) {
// Unmarshal payload proto.
ecp := &pipepb.ExternalConfigurationPayload{}
if err := proto.Unmarshal(plBytes, ecp); err != nil {
diff --git a/sdks/go/pkg/beam/core/runtime/xlangx/registry_test.go b/sdks/go/pkg/beam/core/runtime/xlangx/registry_test.go
index 13e37f4166d..844a8cbd7b8 100644
--- a/sdks/go/pkg/beam/core/runtime/xlangx/registry_test.go
+++ b/sdks/go/pkg/beam/core/runtime/xlangx/registry_test.go
@@ -27,7 +27,7 @@ func TestRegistry(t *testing.T) {
var handler = func(context.Context, *HandlerParams) (*jobpb.ExpansionResponse, error) {
return nil, nil
}
- toPtr := func(fn interface{}) uintptr {
+ toPtr := func(fn any) uintptr {
return reflect.ValueOf(handler).Pointer()
}
diff --git a/sdks/go/pkg/beam/core/sdf/lock.go b/sdks/go/pkg/beam/core/sdf/lock.go
index 8a5d6448ee3..ea26129d34c 100644
--- a/sdks/go/pkg/beam/core/sdf/lock.go
+++ b/sdks/go/pkg/beam/core/sdf/lock.go
@@ -35,7 +35,7 @@ type LockRTracker struct {
// TryClaim locks a mutex for thread safety, and then delegates to the
// underlying tracker's TryClaim.
-func (rt *LockRTracker) TryClaim(pos interface{}) (ok bool) {
+func (rt *LockRTracker) TryClaim(pos any) (ok bool) {
rt.Mu.Lock()
defer rt.Mu.Unlock()
return rt.Rt.TryClaim(pos)
@@ -51,7 +51,7 @@ func (rt *LockRTracker) GetError() error {
// TrySplit locks a mutex for thread safety, and then delegates to the
// underlying tracker's TrySplit.
-func (rt *LockRTracker) TrySplit(fraction float64) (interface{}, interface{}, error) {
+func (rt *LockRTracker) TrySplit(fraction float64) (any, any, error) {
rt.Mu.Lock()
defer rt.Mu.Unlock()
return rt.Rt.TrySplit(fraction)
@@ -75,7 +75,7 @@ func (rt *LockRTracker) IsDone() bool {
// GetRestriction locks a mutex for thread safety, and then delegates to the
// underlying tracker's GetRestriction.
-func (rt *LockRTracker) GetRestriction() interface{} {
+func (rt *LockRTracker) GetRestriction() any {
rt.Mu.Lock()
defer rt.Mu.Unlock()
return rt.Rt.GetRestriction()
diff --git a/sdks/go/pkg/beam/core/sdf/sdf.go b/sdks/go/pkg/beam/core/sdf/sdf.go
index d78af2714fb..b2fb70c5fca 100644
--- a/sdks/go/pkg/beam/core/sdf/sdf.go
+++ b/sdks/go/pkg/beam/core/sdf/sdf.go
@@ -53,7 +53,7 @@ type RTracker interface {
// pos = position of next block within the restriction
// }
// return
- TryClaim(pos interface{}) (ok bool)
+ TryClaim(pos any) (ok bool)
// GetError returns the error that made this RTracker stop executing, and returns nil if no
// error occurred. This is the error that is emitted if automated validation fails.
@@ -80,7 +80,7 @@ type RTracker interface {
// the pipeline failing during the checkpoint.
//
// If an error is returned, some catastrophic failure occurred and the entire bundle will fail.
- TrySplit(fraction float64) (primary, residual interface{}, err error)
+ TrySplit(fraction float64) (primary, residual any, err error)
// GetProgress returns two abstract scalars representing the amount of done and remaining work.
// These values have no specific units, but are used to estimate work in relation to each other
@@ -98,7 +98,7 @@ type RTracker interface {
// GetRestriction returns the restriction this tracker is tracking, or nil if the restriction
// is unavailable for some reason.
- GetRestriction() interface{}
+ GetRestriction() any
}
// BoundableRTracker is an interface used to interact with restrictions that may be bounded or unbounded
diff --git a/sdks/go/pkg/beam/core/state/state.go b/sdks/go/pkg/beam/core/state/state.go
index baa008b6b73..bdec84f6f65 100644
--- a/sdks/go/pkg/beam/core/state/state.go
+++ b/sdks/go/pkg/beam/core/state/state.go
@@ -60,8 +60,8 @@ var (
type Transaction struct {
Key string
Type TransactionTypeEnum
- MapKey interface{}
- Val interface{}
+ MapKey any
+ Val any
}
// Provider represents the DoFn parameter used to get and manipulate pipeline state
@@ -69,18 +69,18 @@ type Transaction struct {
// This should not be manipulated directly. Instead it should be used as a parameter
// to functions on State objects like state.Value.
type Provider interface {
- ReadValueState(id string) (interface{}, []Transaction, error)
+ ReadValueState(id string) (any, []Transaction, error)
WriteValueState(val Transaction) error
ClearValueState(val Transaction) error
- ReadBagState(id string) ([]interface{}, []Transaction, error)
+ ReadBagState(id string) ([]any, []Transaction, error)
WriteBagState(val Transaction) error
ClearBagState(val Transaction) error
CreateAccumulatorFn(userStateID string) reflectx.Func
AddInputFn(userStateID string) reflectx.Func
MergeAccumulatorsFn(userStateID string) reflectx.Func
ExtractOutputFn(userStateID string) reflectx.Func
- ReadMapStateValue(userStateID string, key interface{}) (interface{}, []Transaction, error)
- ReadMapStateKeys(userStateID string) ([]interface{}, []Transaction, error)
+ ReadMapStateValue(userStateID string, key any) (any, []Transaction, error)
+ ReadMapStateKeys(userStateID string) ([]any, []Transaction, error)
WriteMapState(val Transaction) error
ClearMapStateKey(val Transaction) error
ClearMapState(val Transaction) error
@@ -98,7 +98,7 @@ type PipelineState interface {
// CombiningPipelineState is an interface representing combining pipeline state.
// It is primarily meant for Beam packages to use and is probably not useful for most pipeline authors.
type CombiningPipelineState interface {
- GetCombineFn() interface{}
+ GetCombineFn() any
}
// Value is used to read and write global pipeline state representing a single value.
@@ -261,7 +261,7 @@ func MakeBagState[T any](k string) Bag[T] {
// Key represents the key used to lookup this state.
type Combining[T1, T2, T3 any] struct {
Key string
- combineFn interface{}
+ combineFn any
}
// Add is used to write add an element to the combining pipeline state.
@@ -283,11 +283,11 @@ func (s *Combining[T1, T2, T3]) Add(p Provider, val T2) error {
}
if ai := p.AddInputFn(s.Key); ai != nil {
- var newVal interface{}
+ var newVal any
if f, ok := ai.(reflectx.Func2x1); ok {
newVal = f.Call2x1(acc, val)
} else {
- newVal = f.Call([]interface{}{acc, val})[0]
+ newVal = f.Call([]any{acc, val})[0]
}
return p.WriteValueState(Transaction{
Key: s.Key,
@@ -297,11 +297,11 @@ func (s *Combining[T1, T2, T3]) Add(p Provider, val T2) error {
}
// If AddInput isn't defined, that means we must just have one accumulator type identical to the input type.
if ma := p.MergeAccumulatorsFn(s.Key); ma != nil {
- var newVal interface{}
+ var newVal any
if f, ok := ma.(reflectx.Func2x1); ok {
newVal = f.Call2x1(acc, val)
} else {
- newVal = f.Call([]interface{}{acc, val})[0]
+ newVal = f.Call([]any{acc, val})[0]
}
return p.WriteValueState(Transaction{
Key: s.Key,
@@ -328,7 +328,7 @@ func (s *Combining[T1, T2, T3]) Read(p Provider) (T3, bool, error) {
if ok {
return f.Call1x1(acc).(T3), true, nil
}
- return f.Call([]interface{}{acc})[0].(T3), true, nil
+ return f.Call([]any{acc})[0].(T3), true, nil
}
return acc.(T3), true, nil
@@ -342,7 +342,7 @@ func (s *Combining[T1, T2, T3]) Clear(p Provider) error {
})
}
-func (s *Combining[T1, T2, T3]) readAccumulator(p Provider) (interface{}, bool, error) {
+func (s *Combining[T1, T2, T3]) readAccumulator(p Provider) (any, bool, error) {
// This replays any writes that have happened to this value since we last read
// For more detail, see "State Transactionality" below for buffered transactions
cur, bufferedTransactions, err := p.ReadValueState(s.Key)
@@ -364,7 +364,7 @@ func (s *Combining[T1, T2, T3]) readAccumulator(p Provider) (interface{}, bool,
if ok {
return f.Call0x1(), true, nil
}
- return f.Call([]interface{}{})[0], true, nil
+ return f.Call([]any{})[0], true, nil
}
var val T1
return val, false, nil
@@ -395,7 +395,7 @@ func (s Combining[T1, T2, T3]) StateType() TypeEnum {
}
// GetCombineFn returns this state instance's CombineFn
-func (s Combining[T1, T2, T3]) GetCombineFn() interface{} {
+func (s Combining[T1, T2, T3]) GetCombineFn() any {
return s.combineFn
}
@@ -403,7 +403,7 @@ func (s Combining[T1, T2, T3]) GetCombineFn() interface{} {
// when the combiner may have different types for its accumulator, input, and output.
// Takes 3 generic constraints [T1, T2, T3 any] representing the accumulator/input/output types respectively.
// If no accumulator or output types are defined, use the input type.
-func MakeCombiningState[T1, T2, T3 any](k string, combiner interface{}) Combining[T1, T2, T3] {
+func MakeCombiningState[T1, T2, T3 any](k string, combiner any) Combining[T1, T2, T3] {
return Combining[T1, T2, T3]{
Key: k,
combineFn: combiner,
diff --git a/sdks/go/pkg/beam/core/state/state_test.go b/sdks/go/pkg/beam/core/state/state_test.go
index a43d0c612ab..61057c05b63 100644
--- a/sdks/go/pkg/beam/core/state/state_test.go
+++ b/sdks/go/pkg/beam/core/state/state_test.go
@@ -27,9 +27,9 @@ var (
)
type fakeProvider struct {
- initialState map[string]interface{}
- initialBagState map[string][]interface{}
- initialMapState map[string]map[string]interface{}
+ initialState map[string]any
+ initialBagState map[string][]any
+ initialMapState map[string]map[string]any
transactions map[string][]Transaction
err map[string]error
createAccumForKey map[string]bool
@@ -38,7 +38,7 @@ type fakeProvider struct {
extractOutForKey map[string]bool
}
-func (s *fakeProvider) ReadValueState(userStateID string) (interface{}, []Transaction, error) {
+func (s *fakeProvider) ReadValueState(userStateID string) (any, []Transaction, error) {
if err, ok := s.err[userStateID]; ok {
return nil, nil, err
}
@@ -60,7 +60,7 @@ func (s *fakeProvider) ClearValueState(val Transaction) error {
return nil
}
-func (s *fakeProvider) ReadBagState(userStateID string) ([]interface{}, []Transaction, error) {
+func (s *fakeProvider) ReadBagState(userStateID string) ([]any, []Transaction, error) {
if err, ok := s.err[userStateID]; ok {
return nil, nil, err
}
@@ -123,7 +123,7 @@ func (s *fakeProvider) ExtractOutputFn(userStateID string) reflectx.Func {
return nil
}
-func (s *fakeProvider) ReadMapStateValue(userStateID string, key interface{}) (interface{}, []Transaction, error) {
+func (s *fakeProvider) ReadMapStateValue(userStateID string, key any) (any, []Transaction, error) {
keyString := key.(string)
if err, ok := s.err[userStateID]; ok {
return nil, nil, err
@@ -136,12 +136,12 @@ func (s *fakeProvider) ReadMapStateValue(userStateID string, key interface{}) (i
return base, trans, nil
}
-func (s *fakeProvider) ReadMapStateKeys(userStateID string) ([]interface{}, []Transaction, error) {
+func (s *fakeProvider) ReadMapStateKeys(userStateID string) ([]any, []Transaction, error) {
if err, ok := s.err[userStateID]; ok {
return nil, nil, err
}
base := s.initialMapState[userStateID]
- keys := make([]interface{}, len(base))
+ keys := make([]any, len(base))
i := 0
for k := range base {
keys[i] = k
@@ -178,7 +178,7 @@ func (s *fakeProvider) ClearMapState(val Transaction) error {
}
func TestValueRead(t *testing.T) {
- is := make(map[string]interface{})
+ is := make(map[string]any)
ts := make(map[string][]Transaction)
es := make(map[string]error)
is["no_transactions"] = 1
@@ -244,7 +244,7 @@ func TestValueWrite(t *testing.T) {
for _, tt := range tests {
f := fakeProvider{
- initialState: make(map[string]interface{}),
+ initialState: make(map[string]any),
transactions: make(map[string][]Transaction),
err: make(map[string]error),
}
@@ -280,7 +280,7 @@ func TestValueClear(t *testing.T) {
for _, tt := range tests {
f := fakeProvider{
- initialState: make(map[string]interface{}),
+ initialState: make(map[string]any),
transactions: make(map[string][]Transaction),
err: make(map[string]error),
}
@@ -304,22 +304,22 @@ func TestValueClear(t *testing.T) {
}
func TestBagRead(t *testing.T) {
- is := make(map[string][]interface{})
+ is := make(map[string][]any)
ts := make(map[string][]Transaction)
es := make(map[string]error)
- is["no_transactions"] = []interface{}{1}
+ is["no_transactions"] = []any{1}
ts["no_transactions"] = nil
- is["basic_append"] = []interface{}{}
+ is["basic_append"] = []any{}
ts["basic_append"] = []Transaction{{Key: "basic_append", Type: TransactionTypeAppend, Val: 3}}
- is["multi_append"] = []interface{}{}
+ is["multi_append"] = []any{}
ts["multi_append"] = []Transaction{{Key: "multi_append", Type: TransactionTypeAppend, Val: 3}, {Key: "multi_append", Type: TransactionTypeAppend, Val: 2}}
- is["basic_clear"] = []interface{}{1}
+ is["basic_clear"] = []any{1}
ts["basic_clear"] = []Transaction{{Key: "basic_clear", Type: TransactionTypeClear, Val: nil}}
- is["append_then_clear"] = []interface{}{1}
+ is["append_then_clear"] = []any{1}
ts["append_then_clear"] = []Transaction{{Key: "append_then_clear", Type: TransactionTypeAppend, Val: 3}, {Key: "append_then_clear", Type: TransactionTypeClear, Val: nil}}
- is["append_then_clear_then_append"] = []interface{}{1}
+ is["append_then_clear_then_append"] = []any{1}
ts["append_then_clear_then_append"] = []Transaction{{Key: "append_then_clear_then_append", Type: TransactionTypeAppend, Val: 3}, {Key: "append_then_clear_then_append", Type: TransactionTypeClear, Val: nil}, {Key: "append_then_clear_then_append", Type: TransactionTypeAppend, Val: 4}}
- is["err"] = []interface{}{1}
+ is["err"] = []any{1}
ts["err"] = []Transaction{{Key: "err", Type: TransactionTypeAppend, Val: 3}}
es["err"] = errFake
@@ -383,7 +383,7 @@ func TestBagAdd(t *testing.T) {
for _, tt := range tests {
f := fakeProvider{
- initialState: make(map[string]interface{}),
+ initialState: make(map[string]any),
transactions: make(map[string][]Transaction),
err: make(map[string]error),
}
@@ -429,7 +429,7 @@ func TestBagClear(t *testing.T) {
for _, tt := range tests {
f := fakeProvider{
- initialState: make(map[string]interface{}),
+ initialState: make(map[string]any),
transactions: make(map[string][]Transaction),
err: make(map[string]error),
}
@@ -453,7 +453,7 @@ func TestBagClear(t *testing.T) {
}
func TestCombiningRead(t *testing.T) {
- is := make(map[string]interface{})
+ is := make(map[string]any)
ts := make(map[string][]Transaction)
es := make(map[string]error)
ca := make(map[string]bool)
@@ -561,7 +561,7 @@ func TestCombiningClear(t *testing.T) {
}
for _, tt := range tests {
- is := make(map[string]interface{})
+ is := make(map[string]any)
ts := make(map[string][]Transaction)
es := make(map[string]error)
ca := make(map[string]bool)
@@ -643,7 +643,7 @@ func TestCombiningAdd(t *testing.T) {
}
for _, tt := range tests {
- is := make(map[string]interface{})
+ is := make(map[string]any)
ts := make(map[string][]Transaction)
es := make(map[string]error)
ca := make(map[string]bool)
@@ -688,20 +688,20 @@ func TestCombiningAdd(t *testing.T) {
}
func TestMapGet(t *testing.T) {
- is := make(map[string]interface{})
- im := make(map[string]map[string]interface{})
+ is := make(map[string]any)
+ im := make(map[string]map[string]any)
ts := make(map[string][]Transaction)
es := make(map[string]error)
ca := make(map[string]bool)
eo := make(map[string]bool)
ts["no_transactions"] = nil
- im["basic_set"] = map[string]interface{}{"foo": 2}
+ im["basic_set"] = map[string]any{"foo": 2}
ts["basic_set"] = []Transaction{{Key: "basic_set", Type: TransactionTypeSet, Val: 3, MapKey: "foo"}, {Key: "basic_set", Type: TransactionTypeSet, Val: 1, MapKey: "bar"}}
- im["basic_clear"] = map[string]interface{}{"foo": 2, "bar": 1}
+ im["basic_clear"] = map[string]any{"foo": 2, "bar": 1}
ts["basic_clear"] = []Transaction{{Key: "basic_clear", Type: TransactionTypeClear, Val: nil, MapKey: "foo"}}
- im["set_then_clear"] = map[string]interface{}{"foo": 2, "bar": 1}
+ im["set_then_clear"] = map[string]any{"foo": 2, "bar": 1}
ts["set_then_clear"] = []Transaction{{Key: "set_then_clear", Type: TransactionTypeSet, Val: 3, MapKey: "foo"}, {Key: "set_then_clear", Type: TransactionTypeClear, Val: nil, MapKey: "foo"}}
- im["err"] = map[string]interface{}{"foo": 2}
+ im["err"] = map[string]any{"foo": 2}
ts["err"] = []Transaction{{Key: "err", Type: TransactionTypeSet, Val: 3}}
es["err"] = errFake
@@ -758,20 +758,20 @@ func TestMapGet(t *testing.T) {
}
func TestMapKeys(t *testing.T) {
- is := make(map[string]interface{})
- im := make(map[string]map[string]interface{})
+ is := make(map[string]any)
+ im := make(map[string]map[string]any)
ts := make(map[string][]Transaction)
es := make(map[string]error)
ca := make(map[string]bool)
eo := make(map[string]bool)
ts["no_transactions"] = nil
- im["basic_set"] = map[string]interface{}{"foo": 2}
+ im["basic_set"] = map[string]any{"foo": 2}
ts["basic_set"] = []Transaction{{Key: "basic_set", Type: TransactionTypeSet, Val: 3, MapKey: "foo"}, {Key: "basic_set", Type: TransactionTypeSet, Val: 1, MapKey: "bar"}}
- im["basic_clear"] = map[string]interface{}{"foo": 2, "bar": 1}
+ im["basic_clear"] = map[string]any{"foo": 2, "bar": 1}
ts["basic_clear"] = []Transaction{{Key: "basic_clear", Type: TransactionTypeClear, Val: nil, MapKey: "foo"}}
- im["set_then_clear"] = map[string]interface{}{"foo": 2, "bar": 1}
+ im["set_then_clear"] = map[string]any{"foo": 2, "bar": 1}
ts["set_then_clear"] = []Transaction{{Key: "set_then_clear", Type: TransactionTypeSet, Val: 3, MapKey: "foo"}, {Key: "set_then_clear", Type: TransactionTypeClear, Val: nil, MapKey: "foo"}}
- im["err"] = map[string]interface{}{"foo": 2}
+ im["err"] = map[string]any{"foo": 2}
ts["err"] = []Transaction{{Key: "err", Type: TransactionTypeSet, Val: 3}}
es["err"] = errFake
@@ -834,7 +834,7 @@ func TestMapPut(t *testing.T) {
for _, tt := range tests {
f := fakeProvider{
- initialState: make(map[string]interface{}),
+ initialState: make(map[string]any),
transactions: make(map[string][]Transaction),
err: make(map[string]error),
}
@@ -869,7 +869,7 @@ func TestMapRemove(t *testing.T) {
for _, tt := range tests {
f := fakeProvider{
- initialState: make(map[string]interface{}),
+ initialState: make(map[string]any),
transactions: make(map[string][]Transaction),
err: make(map[string]error),
}
@@ -913,7 +913,7 @@ func TestMapClear(t *testing.T) {
for _, tt := range tests {
f := fakeProvider{
- initialState: make(map[string]interface{}),
+ initialState: make(map[string]any),
transactions: make(map[string][]Transaction),
err: make(map[string]error),
}
@@ -945,20 +945,20 @@ func TestMapClear(t *testing.T) {
}
func TestSetContains(t *testing.T) {
- is := make(map[string]interface{})
- im := make(map[string]map[string]interface{})
+ is := make(map[string]any)
+ im := make(map[string]map[string]any)
ts := make(map[string][]Transaction)
es := make(map[string]error)
ca := make(map[string]bool)
eo := make(map[string]bool)
ts["no_transactions"] = nil
- im["basic_set"] = map[string]interface{}{}
+ im["basic_set"] = map[string]any{}
ts["basic_set"] = []Transaction{{Key: "basic_set", Type: TransactionTypeSet, Val: true, MapKey: "foo"}, {Key: "basic_set", Type: TransactionTypeSet, Val: true, MapKey: "bar"}}
- im["basic_clear"] = map[string]interface{}{"foo": true, "bar": true}
+ im["basic_clear"] = map[string]any{"foo": true, "bar": true}
ts["basic_clear"] = []Transaction{{Key: "basic_clear", Type: TransactionTypeClear, Val: nil, MapKey: "foo"}}
- im["set_then_clear"] = map[string]interface{}{"foo": true, "bar": true}
+ im["set_then_clear"] = map[string]any{"foo": true, "bar": true}
ts["set_then_clear"] = []Transaction{{Key: "set_then_clear", Type: TransactionTypeSet, Val: true, MapKey: "foo"}, {Key: "set_then_clear", Type: TransactionTypeClear, Val: nil, MapKey: "foo"}}
- im["err"] = map[string]interface{}{"foo": true}
+ im["err"] = map[string]any{"foo": true}
ts["err"] = []Transaction{{Key: "err", Type: TransactionTypeSet, Val: true}}
es["err"] = errFake
@@ -1009,20 +1009,20 @@ func TestSetContains(t *testing.T) {
}
func TestSetKeys(t *testing.T) {
- is := make(map[string]interface{})
- im := make(map[string]map[string]interface{})
+ is := make(map[string]any)
+ im := make(map[string]map[string]any)
ts := make(map[string][]Transaction)
es := make(map[string]error)
ca := make(map[string]bool)
eo := make(map[string]bool)
ts["no_transactions"] = nil
- im["basic_set"] = map[string]interface{}{"foo": true}
+ im["basic_set"] = map[string]any{"foo": true}
ts["basic_set"] = []Transaction{{Key: "basic_set", Type: TransactionTypeSet, Val: true, MapKey: "foo"}, {Key: "basic_set", Type: TransactionTypeSet, Val: true, MapKey: "bar"}}
- im["basic_clear"] = map[string]interface{}{"foo": true, "bar": true}
+ im["basic_clear"] = map[string]any{"foo": true, "bar": true}
ts["basic_clear"] = []Transaction{{Key: "basic_clear", Type: TransactionTypeClear, Val: nil, MapKey: "foo"}}
- im["set_then_clear"] = map[string]interface{}{"foo": true, "bar": true}
+ im["set_then_clear"] = map[string]any{"foo": true, "bar": true}
ts["set_then_clear"] = []Transaction{{Key: "set_then_clear", Type: TransactionTypeSet, Val: true, MapKey: "foo"}, {Key: "set_then_clear", Type: TransactionTypeClear, Val: nil, MapKey: "foo"}}
- im["err"] = map[string]interface{}{"foo": true}
+ im["err"] = map[string]any{"foo": true}
ts["err"] = []Transaction{{Key: "err", Type: TransactionTypeSet, Val: true}}
es["err"] = errFake
@@ -1085,7 +1085,7 @@ func TestSetAdd(t *testing.T) {
for _, tt := range tests {
f := fakeProvider{
- initialState: make(map[string]interface{}),
+ initialState: make(map[string]any),
transactions: make(map[string][]Transaction),
err: make(map[string]error),
}
@@ -1126,7 +1126,7 @@ func TestSetRemove(t *testing.T) {
for _, tt := range tests {
f := fakeProvider{
- initialState: make(map[string]interface{}),
+ initialState: make(map[string]any),
transactions: make(map[string][]Transaction),
err: make(map[string]error),
}
@@ -1170,7 +1170,7 @@ func TestSetClear(t *testing.T) {
for _, tt := range tests {
f := fakeProvider{
- initialState: make(map[string]interface{}),
+ initialState: make(map[string]any),
transactions: make(map[string][]Transaction),
err: make(map[string]error),
}
diff --git a/sdks/go/pkg/beam/core/typex/class_test.go b/sdks/go/pkg/beam/core/typex/class_test.go
index 44b1c7f103f..7fe558f854b 100644
--- a/sdks/go/pkg/beam/core/typex/class_test.go
+++ b/sdks/go/pkg/beam/core/typex/class_test.go
@@ -58,10 +58,10 @@ func TestClassOf(t *testing.T) {
{reflect.TypeOf([1]string{}), Concrete},
{reflect.TypeOf([0]string{}), Concrete},
{reflect.TypeOf([3]struct{ Q []string }{}), Concrete},
- {reflect.TypeOf([0]interface{}{}), Concrete},
+ {reflect.TypeOf([0]any{}), Concrete},
{reflect.TypeOf([1]string{}), Concrete},
{reflect.TypeOf([0]string{}), Concrete},
- {reflect.TypeOf([0]interface{}{}), Concrete},
+ {reflect.TypeOf([0]any{}), Concrete},
{reflect.PtrTo(reflectx.String), Concrete},
{reflect.PtrTo(reflectx.Uint32), Concrete},
{reflect.PtrTo(reflectx.Bool), Concrete},
@@ -101,7 +101,7 @@ func TestClassOf(t *testing.T) {
{CoGBKType, Composite},
{WindowedValueType, Composite},
- {reflect.TypeOf((*interface{})(nil)).Elem(), Concrete}, // special
+ {reflect.TypeOf((*any)(nil)).Elem(), Concrete}, // special
{reflect.TypeOf(uintptr(0)), Invalid}, // uintptr
{reflect.TypeOf(func() {}), Invalid}, // function
diff --git a/sdks/go/pkg/beam/core/typex/special.go b/sdks/go/pkg/beam/core/typex/special.go
index c6512057b54..067cef1fb4f 100644
--- a/sdks/go/pkg/beam/core/typex/special.go
+++ b/sdks/go/pkg/beam/core/typex/special.go
@@ -49,13 +49,13 @@ var (
// T, U, V, W, X, Y, Z are universal types. They play the role of generic
// type variables in UserFn signatures, but are limited to top-level positions.
-type T interface{}
-type U interface{}
-type V interface{}
-type W interface{}
-type X interface{}
-type Y interface{}
-type Z interface{}
+type T any
+type U any
+type V any
+type W any
+type X any
+type Y any
+type Z any
// EventTime is a timestamp that Beam understands as attached to an element.
type EventTime = mtime.Time
diff --git a/sdks/go/pkg/beam/core/util/jsonx/jsonx.go b/sdks/go/pkg/beam/core/util/jsonx/jsonx.go
index 775b9604216..a46ada5343f 100644
--- a/sdks/go/pkg/beam/core/util/jsonx/jsonx.go
+++ b/sdks/go/pkg/beam/core/util/jsonx/jsonx.go
@@ -25,7 +25,7 @@ import (
)
// Marshal encodes a given value as JSON, and returns the bytes.
-func Marshal(elem interface{}) ([]byte, error) {
+func Marshal(elem any) ([]byte, error) {
var bb bytes.Buffer
if err := MarshalTo(elem, &bb); err != nil {
return nil, err
@@ -34,20 +34,20 @@ func Marshal(elem interface{}) ([]byte, error) {
}
// MarshalTo encodes a given value as JSON, and returns the bytes.
-func MarshalTo(elem interface{}, w io.Writer) error {
+func MarshalTo(elem any, w io.Writer) error {
enc := json.NewEncoder(w)
return enc.Encode(elem)
}
// Unmarshal decodes a given value as JSON, and returns the bytes.
// The passed in element must be a pointer of the given type.
-func Unmarshal(elem interface{}, data []byte) error {
+func Unmarshal(elem any, data []byte) error {
return UnmarshalFrom(elem, bytes.NewReader(data))
}
// UnmarshalFrom decodes a given value as JSON, and returns the bytes.
// The passed in element must be a pointer of the given type.
-func UnmarshalFrom(elem interface{}, r io.Reader) error {
+func UnmarshalFrom(elem any, r io.Reader) error {
dec := json.NewDecoder(r)
return dec.Decode(elem)
}
diff --git a/sdks/go/pkg/beam/core/util/reflectx/call.go b/sdks/go/pkg/beam/core/util/reflectx/call.go
index d66716ae3f4..9b1955427f7 100644
--- a/sdks/go/pkg/beam/core/util/reflectx/call.go
+++ b/sdks/go/pkg/beam/core/util/reflectx/call.go
@@ -36,18 +36,18 @@ type Func interface {
// Type returns the type.
Type() reflect.Type
// Call invokes the implicit fn with arguments.
- Call(args []interface{}) []interface{}
+ Call(args []any) []any
}
var (
- funcs = make(map[string]func(interface{}) Func)
+ funcs = make(map[string]func(any) Func)
funcsMu sync.Mutex
)
// RegisterFunc registers an custom Func factory for the given type, such as
// "func(int)bool". If multiple Func factories are registered for the same type,
// the last registration wins.
-func RegisterFunc(t reflect.Type, maker func(interface{}) Func) {
+func RegisterFunc(t reflect.Type, maker func(any) Func) {
funcsMu.Lock()
defer funcsMu.Unlock()
@@ -56,7 +56,7 @@ func RegisterFunc(t reflect.Type, maker func(interface{}) Func) {
}
// MakeFunc returns a Func for given function.
-func MakeFunc(fn interface{}) Func {
+func MakeFunc(fn any) Func {
funcsMu.Lock()
maker, exists := funcs[reflect.TypeOf(fn).String()]
funcsMu.Unlock()
@@ -83,12 +83,12 @@ func (c *reflectFunc) Type() reflect.Type {
return c.fn.Type()
}
-func (c *reflectFunc) Call(args []interface{}) []interface{} {
+func (c *reflectFunc) Call(args []any) []any {
return Interface(c.fn.Call(ValueOf(args)))
}
// CallNoPanic calls the given Func and catches any panic.
-func CallNoPanic(fn Func, args []interface{}) (ret []interface{}, err error) {
+func CallNoPanic(fn Func, args []any) (ret []any, err error) {
defer func() {
if r := recover(); r != nil {
err = errors.Errorf("panic: %v %s", r, debug.Stack())
@@ -98,7 +98,7 @@ func CallNoPanic(fn Func, args []interface{}) (ret []interface{}, err error) {
}
// ValueOf performs a per-element reflect.ValueOf.
-func ValueOf(list []interface{}) []reflect.Value {
+func ValueOf(list []any) []reflect.Value {
ret := make([]reflect.Value, len(list))
for i := 0; i < len(list); i++ {
ret[i] = reflect.ValueOf(list[i])
@@ -107,8 +107,8 @@ func ValueOf(list []interface{}) []reflect.Value {
}
// Interface performs a per-element Interface call.
-func Interface(list []reflect.Value) []interface{} {
- ret := make([]interface{}, len(list))
+func Interface(list []reflect.Value) []any {
+ ret := make([]any, len(list))
for i := 0; i < len(list); i++ {
ret[i] = list[i].Interface()
}
diff --git a/sdks/go/pkg/beam/core/util/reflectx/call_test.go b/sdks/go/pkg/beam/core/util/reflectx/call_test.go
index c133ed8e68c..f89151fd232 100644
--- a/sdks/go/pkg/beam/core/util/reflectx/call_test.go
+++ b/sdks/go/pkg/beam/core/util/reflectx/call_test.go
@@ -25,7 +25,7 @@ type mapperString struct {
fn func(string) string
}
-func mapperStringMaker(fn interface{}) Func {
+func mapperStringMaker(fn any) Func {
f := fn.(func(string) string)
return &mapperString{fn: f}
}
@@ -38,12 +38,12 @@ func (c *mapperString) Type() reflect.Type {
return reflect.TypeOf(c.fn)
}
-func (c *mapperString) Call(args []interface{}) []interface{} {
+func (c *mapperString) Call(args []any) []any {
out := c.fn(args[0].(string))
- return []interface{}{out}
+ return []any{out}
}
-func (c *mapperString) Call1x1(v interface{}) interface{} {
+func (c *mapperString) Call1x1(v any) any {
return c.fn(v.(string))
}
@@ -66,7 +66,7 @@ func TestCallNoPanic(t *testing.T) {
}
madeFn := MakeFunc(fn)
- ret, err := CallNoPanic(madeFn, []interface{}{"tester"})
+ ret, err := CallNoPanic(madeFn, []any{"tester"})
if err != nil {
t.Fatalf("CallNoPanic(madeFn, [\"tester\"]) - unexpected error %v", err)
}
@@ -85,7 +85,7 @@ func TestCallNoPanic_Panic(t *testing.T) {
}
madeFn := MakeFunc(fn)
- _, err := CallNoPanic(madeFn, []interface{}{"tester"})
+ _, err := CallNoPanic(madeFn, []any{"tester"})
if err == nil {
t.Fatalf("CallNoPanic(madeFn, [\"tester\"]) didn't error when it should have")
}
@@ -95,7 +95,7 @@ func TestCallNoPanic_Panic(t *testing.T) {
}
func TestValue(t *testing.T) {
- interfaces := []interface{}{"hi", 42, func() {}}
+ interfaces := []any{"hi", 42, func() {}}
want := []reflect.Kind{reflect.String, reflect.Int, reflect.Func}
got := ValueOf(interfaces)
@@ -110,7 +110,7 @@ func TestValue(t *testing.T) {
}
func TestInterface(t *testing.T) {
- interfaces := []interface{}{"hi", 42}
+ interfaces := []any{"hi", 42}
values := ValueOf(interfaces)
got := Interface(values)
diff --git a/sdks/go/pkg/beam/core/util/reflectx/calls.go b/sdks/go/pkg/beam/core/util/reflectx/calls.go
index 12538cc5602..e2cabaf8c87 100644
--- a/sdks/go/pkg/beam/core/util/reflectx/calls.go
+++ b/sdks/go/pkg/beam/core/util/reflectx/calls.go
@@ -50,12 +50,12 @@ func (c *shimFunc0x0) Type() reflect.Type {
return c.inner.Type()
}
-func (c *shimFunc0x0) Call(args []interface{}) []interface{} {
+func (c *shimFunc0x0) Call(args []any) []any {
return c.inner.Call(args)
}
func (c *shimFunc0x0) Call0x0() {
- ret := c.inner.Call([]interface{}{})
+ ret := c.inner.Call([]any{})
_ = ret
return
}
@@ -70,13 +70,13 @@ func ToFunc0x0(c Func) Func0x0 {
return &shimFunc0x0{inner: c}
}
-func MakeFunc0x0(fn interface{}) Func0x0 {
+func MakeFunc0x0(fn any) Func0x0 {
return ToFunc0x0(MakeFunc(fn))
}
type Func0x1 interface {
Func
- Call0x1() interface{}
+ Call0x1() any
}
type shimFunc0x1 struct {
@@ -91,12 +91,12 @@ func (c *shimFunc0x1) Type() reflect.Type {
return c.inner.Type()
}
-func (c *shimFunc0x1) Call(args []interface{}) []interface{} {
+func (c *shimFunc0x1) Call(args []any) []any {
return c.inner.Call(args)
}
-func (c *shimFunc0x1) Call0x1() interface{} {
- ret := c.inner.Call([]interface{}{})
+func (c *shimFunc0x1) Call0x1() any {
+ ret := c.inner.Call([]any{})
_ = ret
return ret[0]
}
@@ -111,13 +111,13 @@ func ToFunc0x1(c Func) Func0x1 {
return &shimFunc0x1{inner: c}
}
-func MakeFunc0x1(fn interface{}) Func0x1 {
+func MakeFunc0x1(fn any) Func0x1 {
return ToFunc0x1(MakeFunc(fn))
}
type Func0x2 interface {
Func
- Call0x2() (interface{}, interface{})
+ Call0x2() (any, any)
}
type shimFunc0x2 struct {
@@ -132,12 +132,12 @@ func (c *shimFunc0x2) Type() reflect.Type {
return c.inner.Type()
}
-func (c *shimFunc0x2) Call(args []interface{}) []interface{} {
+func (c *shimFunc0x2) Call(args []any) []any {
return c.inner.Call(args)
}
-func (c *shimFunc0x2) Call0x2() (interface{}, interface{}) {
- ret := c.inner.Call([]interface{}{})
+func (c *shimFunc0x2) Call0x2() (any, any) {
+ ret := c.inner.Call([]any{})
_ = ret
return ret[0], ret[1]
}
@@ -152,13 +152,13 @@ func ToFunc0x2(c Func) Func0x2 {
return &shimFunc0x2{inner: c}
}
-func MakeFunc0x2(fn interface{}) Func0x2 {
+func MakeFunc0x2(fn any) Func0x2 {
return ToFunc0x2(MakeFunc(fn))
}
type Func0x3 interface {
Func
- Call0x3() (interface{}, interface{}, interface{})
+ Call0x3() (any, any, any)
}
type shimFunc0x3 struct {
@@ -173,12 +173,12 @@ func (c *shimFunc0x3) Type() reflect.Type {
return c.inner.Type()
}
-func (c *shimFunc0x3) Call(args []interface{}) []interface{} {
+func (c *shimFunc0x3) Call(args []any) []any {
return c.inner.Call(args)
}
-func (c *shimFunc0x3) Call0x3() (interface{}, interface{}, interface{}) {
- ret := c.inner.Call([]interface{}{})
+func (c *shimFunc0x3) Call0x3() (any, any, any) {
+ ret := c.inner.Call([]any{})
_ = ret
return ret[0], ret[1], ret[2]
}
@@ -193,13 +193,13 @@ func ToFunc0x3(c Func) Func0x3 {
return &shimFunc0x3{inner: c}
}
-func MakeFunc0x3(fn interface{}) Func0x3 {
+func MakeFunc0x3(fn any) Func0x3 {
return ToFunc0x3(MakeFunc(fn))
}
type Func0x4 interface {
Func
- Call0x4() (interface{}, interface{}, interface{}, interface{})
+ Call0x4() (any, any, any, any)
}
type shimFunc0x4 struct {
@@ -214,12 +214,12 @@ func (c *shimFunc0x4) Type() reflect.Type {
return c.inner.Type()
}
-func (c *shimFunc0x4) Call(args []interface{}) []interface{} {
+func (c *shimFunc0x4) Call(args []any) []any {
return c.inner.Call(args)
}
-func (c *shimFunc0x4) Call0x4() (interface{}, interface{}, interface{}, interface{}) {
- ret := c.inner.Call([]interface{}{})
+func (c *shimFunc0x4) Call0x4() (any, any, any, any) {
+ ret := c.inner.Call([]any{})
_ = ret
return ret[0], ret[1], ret[2], ret[3]
}
@@ -234,13 +234,13 @@ func ToFunc0x4(c Func) Func0x4 {
return &shimFunc0x4{inner: c}
}
-func MakeFunc0x4(fn interface{}) Func0x4 {
+func MakeFunc0x4(fn any) Func0x4 {
return ToFunc0x4(MakeFunc(fn))
}
type Func1x0 interface {
Func
- Call1x0(interface{})
+ Call1x0(any)
}
type shimFunc1x0 struct {
@@ -255,12 +255,12 @@ func (c *shimFunc1x0) Type() reflect.Type {
return c.inner.Type()
}
-func (c *shimFunc1x0) Call(args []interface{}) []interface{} {
+func (c *shimFunc1x0) Call(args []any) []any {
return c.inner.Call(args)
}
-func (c *shimFunc1x0) Call1x0(arg0 interface{}) {
- ret := c.inner.Call([]interface{}{arg0})
+func (c *shimFunc1x0) Call1x0(arg0 any) {
+ ret := c.inner.Call([]any{arg0})
_ = ret
return
}
@@ -275,13 +275,13 @@ func ToFunc1x0(c Func) Func1x0 {
return &shimFunc1x0{inner: c}
}
-func MakeFunc1x0(fn interface{}) Func1x0 {
+func MakeFunc1x0(fn any) Func1x0 {
return ToFunc1x0(MakeFunc(fn))
}
type Func1x1 interface {
Func
- Call1x1(interface{}) interface{}
+ Call1x1(any) any
}
type shimFunc1x1 struct {
@@ -296,12 +296,12 @@ func (c *shimFunc1x1) Type() reflect.Type {
return c.inner.Type()
}
-func (c *shimFunc1x1) Call(args []interface{}) []interface{} {
+func (c *shimFunc1x1) Call(args []any) []any {
return c.inner.Call(args)
}
-func (c *shimFunc1x1) Call1x1(arg0 interface{}) interface{} {
- ret := c.inner.Call([]interface{}{arg0})
+func (c *shimFunc1x1) Call1x1(arg0 any) any {
+ ret := c.inner.Call([]any{arg0})
_ = ret
return ret[0]
}
@@ -316,13 +316,13 @@ func ToFunc1x1(c Func) Func1x1 {
return &shimFunc1x1{inner: c}
}
-func MakeFunc1x1(fn interface{}) Func1x1 {
+func MakeFunc1x1(fn any) Func1x1 {
return ToFunc1x1(MakeFunc(fn))
}
type Func1x2 interface {
Func
- Call1x2(interface{}) (interface{}, interface{})
+ Call1x2(any) (any, any)
}
type shimFunc1x2 struct {
@@ -337,12 +337,12 @@ func (c *shimFunc1x2) Type() reflect.Type {
return c.inner.Type()
}
-func (c *shimFunc1x2) Call(args []interface{}) []interface{} {
+func (c *shimFunc1x2) Call(args []any) []any {
return c.inner.Call(args)
}
-func (c *shimFunc1x2) Call1x2(arg0 interface{}) (interface{}, interface{}) {
- ret := c.inner.Call([]interface{}{arg0})
+func (c *shimFunc1x2) Call1x2(arg0 any) (any, any) {
+ ret := c.inner.Call([]any{arg0})
_ = ret
return ret[0], ret[1]
}
@@ -357,13 +357,13 @@ func ToFunc1x2(c Func) Func1x2 {
return &shimFunc1x2{inner: c}
}
-func MakeFunc1x2(fn interface{}) Func1x2 {
+func MakeFunc1x2(fn any) Func1x2 {
return ToFunc1x2(MakeFunc(fn))
}
type Func1x3 interface {
Func
- Call1x3(interface{}) (interface{}, interface{}, interface{})
+ Call1x3(any) (any, any, any)
}
type shimFunc1x3 struct {
@@ -378,12 +378,12 @@ func (c *shimFunc1x3) Type() reflect.Type {
return c.inner.Type()
}
-func (c *shimFunc1x3) Call(args []interface{}) []interface{} {
+func (c *shimFunc1x3) Call(args []any) []any {
return c.inner.Call(args)
}
-func (c *shimFunc1x3) Call1x3(arg0 interface{}) (interface{}, interface{}, interface{}) {
- ret := c.inner.Call([]interface{}{arg0})
+func (c *shimFunc1x3) Call1x3(arg0 any) (any, any, any) {
+ ret := c.inner.Call([]any{arg0})
_ = ret
return ret[0], ret[1], ret[2]
}
@@ -398,13 +398,13 @@ func ToFunc1x3(c Func) Func1x3 {
return &shimFunc1x3{inner: c}
}
-func MakeFunc1x3(fn interface{}) Func1x3 {
+func MakeFunc1x3(fn any) Func1x3 {
return ToFunc1x3(MakeFunc(fn))
}
type Func1x4 interface {
Func
- Call1x4(interface{}) (interface{}, interface{}, interface{}, interface{})
+ Call1x4(any) (any, any, any, any)
}
type shimFunc1x4 struct {
@@ -419,12 +419,12 @@ func (c *shimFunc1x4) Type() reflect.Type {
return c.inner.Type()
}
-func (c *shimFunc1x4) Call(args []interface{}) []interface{} {
+func (c *shimFunc1x4) Call(args []any) []any {
return c.inner.Call(args)
}
-func (c *shimFunc1x4) Call1x4(arg0 interface{}) (interface{}, interface{}, interface{}, interface{}) {
- ret := c.inner.Call([]interface{}{arg0})
+func (c *shimFunc1x4) Call1x4(arg0 any) (any, any, any, any) {
+ ret := c.inner.Call([]any{arg0})
_ = ret
return ret[0], ret[1], ret[2], ret[3]
}
@@ -439,13 +439,13 @@ func ToFunc1x4(c Func) Func1x4 {
return &shimFunc1x4{inner: c}
}
-func MakeFunc1x4(fn interface{}) Func1x4 {
+func MakeFunc1x4(fn any) Func1x4 {
return ToFunc1x4(MakeFunc(fn))
}
type Func2x0 interface {
Func
- Call2x0(interface{}, interface{})
+ Call2x0(any, any)
}
type shimFunc2x0 struct {
@@ -460,12 +460,12 @@ func (c *shimFunc2x0) Type() reflect.Type {
return c.inner.Type()
}
-func (c *shimFunc2x0) Call(args []interface{}) []interface{} {
+func (c *shimFunc2x0) Call(args []any) []any {
return c.inner.Call(args)
}
-func (c *shimFunc2x0) Call2x0(arg0, arg1 interface{}) {
- ret := c.inner.Call([]interface{}{arg0, arg1})
+func (c *shimFunc2x0) Call2x0(arg0, arg1 any) {
+ ret := c.inner.Call([]any{arg0, arg1})
_ = ret
return
}
@@ -480,13 +480,13 @@ func ToFunc2x0(c Func) Func2x0 {
return &shimFunc2x0{inner: c}
}
-func MakeFunc2x0(fn interface{}) Func2x0 {
+func MakeFunc2x0(fn any) Func2x0 {
return ToFunc2x0(MakeFunc(fn))
}
type Func2x1 interface {
Func
- Call2x1(interface{}, interface{}) interface{}
+ Call2x1(any, any) any
}
type shimFunc2x1 struct {
@@ -501,12 +501,12 @@ func (c *shimFunc2x1) Type() reflect.Type {
return c.inner.Type()
}
-func (c *shimFunc2x1) Call(args []interface{}) []interface{} {
+func (c *shimFunc2x1) Call(args []any) []any {
return c.inner.Call(args)
}
-func (c *shimFunc2x1) Call2x1(arg0, arg1 interface{}) interface{} {
- ret := c.inner.Call([]interface{}{arg0, arg1})
+func (c *shimFunc2x1) Call2x1(arg0, arg1 any) any {
+ ret := c.inner.Call([]any{arg0, arg1})
_ = ret
return ret[0]
}
@@ -521,13 +521,13 @@ func ToFunc2x1(c Func) Func2x1 {
return &shimFunc2x1{inner: c}
}
-func MakeFunc2x1(fn interface{}) Func2x1 {
+func MakeFunc2x1(fn any) Func2x1 {
return ToFunc2x1(MakeFunc(fn))
}
type Func2x2 interface {
Func
- Call2x2(interface{}, interface{}) (interface{}, interface{})
+ Call2x2(any, any) (any, any)
}
type shimFunc2x2 struct {
@@ -542,12 +542,12 @@ func (c *shimFunc2x2) Type() reflect.Type {
return c.inner.Type()
}
-func (c *shimFunc2x2) Call(args []interface{}) []interface{} {
+func (c *shimFunc2x2) Call(args []any) []any {
return c.inner.Call(args)
}
-func (c *shimFunc2x2) Call2x2(arg0, arg1 interface{}) (interface{}, interface{}) {
- ret := c.inner.Call([]interface{}{arg0, arg1})
+func (c *shimFunc2x2) Call2x2(arg0, arg1 any) (any, any) {
+ ret := c.inner.Call([]any{arg0, arg1})
_ = ret
return ret[0], ret[1]
}
@@ -562,13 +562,13 @@ func ToFunc2x2(c Func) Func2x2 {
return &shimFunc2x2{inner: c}
}
-func MakeFunc2x2(fn interface{}) Func2x2 {
+func MakeFunc2x2(fn any) Func2x2 {
return ToFunc2x2(MakeFunc(fn))
}
type Func2x3 interface {
Func
- Call2x3(interface{}, interface{}) (interface{}, interface{}, interface{})
+ Call2x3(any, any) (any, any, any)
}
type shimFunc2x3 struct {
@@ -583,12 +583,12 @@ func (c *shimFunc2x3) Type() reflect.Type {
return c.inner.Type()
}
-func (c *shimFunc2x3) Call(args []interface{}) []interface{} {
+func (c *shimFunc2x3) Call(args []any) []any {
return c.inner.Call(args)
}
-func (c *shimFunc2x3) Call2x3(arg0, arg1 interface{}) (interface{}, interface{}, interface{}) {
- ret := c.inner.Call([]interface{}{arg0, arg1})
+func (c *shimFunc2x3) Call2x3(arg0, arg1 any) (any, any, any) {
+ ret := c.inner.Call([]any{arg0, arg1})
_ = ret
return ret[0], ret[1], ret[2]
}
@@ -603,13 +603,13 @@ func ToFunc2x3(c Func) Func2x3 {
return &shimFunc2x3{inner: c}
}
-func MakeFunc2x3(fn interface{}) Func2x3 {
... 1229 lines suppressed ...