From 6614757ec8d5b6f1f9959b6b9eccf3c945530eae Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 28 Oct 2024 13:52:07 +0000 Subject: [PATCH] gomod: Update to 1.23, add types.Alias case --- go.mod | 2 +- internal/template.go | 13 ++- internal/testdata/dev_exchange_graph.golden | 2 +- .../testdata/dev_exchange_selected.golden | 2 +- .../testdata/dev_exchange_specBack.golden | 2 +- internal/testdata/dev_exchange_tpldata.golden | 2 +- .../testdata/dev_exchange_weldoutput.golden | 4 +- .../example/duplicate/state/backends_gen.go | 8 ++ .../example/duplicate/state/weld_gen.go | 27 ++++++ .../exchange/state/devstate/weld_gen.go | 4 +- .../example/exchange/state/weld_gen.go | 4 +- .../example/no_err/state/backends_gen.go | 7 ++ .../testdata/example/no_err/state/weld_gen.go | 23 +++++ .../example/samevar/state/backends_gen.go | 12 +++ .../example/samevar/state/weld_gen.go | 32 +++++++ .../sort_with_bind/state/backends_gen.go | 13 +++ .../example/sort_with_bind/state/weld_gen.go | 40 ++++++++ .../example/transitive/state/backends_gen.go | 14 +++ .../example/transitive/state/testing_gen.go | 93 +++++++++++++++++++ .../example/transitive/state/weld_gen.go | 57 ++++++++++++ .../example/variadic/state/backends_gen.go | 11 +++ .../example/variadic/state/weld_gen.go | 32 +++++++ internal/testdata/exchange_graph.golden | 2 +- internal/testdata/exchange_selected.golden | 2 +- internal/testdata/exchange_specBack.golden | 2 +- internal/testdata/exchange_tpldata.golden | 2 +- internal/testdata/exchange_weldoutput.golden | 4 +- 27 files changed, 398 insertions(+), 18 deletions(-) create mode 100644 internal/testdata/example/duplicate/state/backends_gen.go create mode 100644 internal/testdata/example/duplicate/state/weld_gen.go create mode 100644 internal/testdata/example/no_err/state/backends_gen.go create mode 100644 internal/testdata/example/no_err/state/weld_gen.go create mode 100644 internal/testdata/example/samevar/state/backends_gen.go create mode 100644 internal/testdata/example/samevar/state/weld_gen.go create mode 100644 internal/testdata/example/sort_with_bind/state/backends_gen.go create mode 100644 internal/testdata/example/sort_with_bind/state/weld_gen.go create mode 100644 internal/testdata/example/transitive/state/backends_gen.go create mode 100644 internal/testdata/example/transitive/state/testing_gen.go create mode 100644 internal/testdata/example/transitive/state/weld_gen.go create mode 100644 internal/testdata/example/variadic/state/backends_gen.go create mode 100644 internal/testdata/example/variadic/state/weld_gen.go diff --git a/go.mod b/go.mod index ab54eee..747a4e6 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/luno/weld -go 1.22 +go 1.23.2 require ( github.com/luno/jettison v0.0.0-20240722160230-b42bd507a5f6 diff --git a/internal/template.go b/internal/template.go index 48213c9..eba38a1 100644 --- a/internal/template.go +++ b/internal/template.go @@ -235,7 +235,13 @@ func makeTplBcks(pkgCache *PkgCache, bcks []Backends) ([]string, error) { } // makeTplDep returns the template dependency and template imports of the dependency. -func makeTplDep(pkgCache *PkgCache, nodes []Node, getter string, dep types.Type, varMap map[string]string) (*TplDep, error) { +func makeTplDep( + pkgCache *PkgCache, + nodes []Node, + getter string, + dep types.Type, + varMap map[string]string, +) (*TplDep, error) { for _, node := range nodes { if node.Type == NodeTypeBind { if !types.Identical(node.BindInterface, dep) { @@ -567,6 +573,11 @@ func getTypePkgs(tl ...types.Type) ([]*types.Package, error) { tl := tupleTypes(t.Params()) tl = append(tl, tupleTypes(t.Results())...) pl, err = getTypePkgs(tl...) + case *types.Alias: + pkg := t.Obj().Pkg() + if pkg != nil { + pl = []*types.Package{pkg} + } default: return nil, errors.New("cannot detect import for type", j.MKV{"type": t}) } diff --git a/internal/testdata/dev_exchange_graph.golden b/internal/testdata/dev_exchange_graph.golden index 6f1679e..5c9935b 100644 --- a/internal/testdata/dev_exchange_graph.golden +++ b/internal/testdata/dev_exchange_graph.golden @@ -14,4 +14,4 @@ Set[11]: (inline) Func[1]: func example/external/mail.New(opts ...example/external/mail.option) (*example/external/mail.Mailer, error) Func[1]: func example/external/mail/mail.New() (*example/external/mail/mail.MailerLegacy, error) Func[1]: func example/external/versioned.New() *example/external/versioned/v1.Service - Func[1]: func example/exchange/state.NewGenericStringType() example/exchange/ops.TestFunc[example/exchange.Model, string] + Func[1]: func example/exchange/state.NewGenericStringType() example/exchange/ops.GenericStringType diff --git a/internal/testdata/dev_exchange_selected.golden b/internal/testdata/dev_exchange_selected.golden index ef6b93c..5db94ef 100644 --- a/internal/testdata/dev_exchange_selected.golden +++ b/internal/testdata/dev_exchange_selected.golden @@ -1,7 +1,7 @@ Func[1]: func example/exchange/db.Connect() (*example/exchange/db.ExchangeDB, error) Func[1]: func example/external/versioned.New() *example/external/versioned/v1.Service Func[1]: func example/exchange/state.NewModelChan() chan<- example/exchange.Model -Func[1]: func example/exchange/state.NewGenericStringType() example/exchange/ops.TestFunc[example/exchange.Model, string] +Func[1]: func example/exchange/state.NewGenericStringType() example/exchange/ops.GenericStringType Func[1]: func example/identity/email/client/dev.Make(b example/identity/email/client/logical.Backends) (example/identity/email.Client, error) Func[1]: func example/identity/users/client/dev.Make(b example/identity/users/client/logical.Backends) (example/identity/users.Client, error) Func[1]: func example/identity/email/db.Connect() (*example/identity/email/db.EmailDB, error) diff --git a/internal/testdata/dev_exchange_specBack.golden b/internal/testdata/dev_exchange_specBack.golden index 5b920a3..8084a38 100644 --- a/internal/testdata/dev_exchange_specBack.golden +++ b/internal/testdata/dev_exchange_specBack.golden @@ -1 +1 @@ -example/exchange/ops.Backends[6]: *example/exchange/db.ExchangeDB, *example/external/versioned/v1.Service, chan<- example/exchange.Model, example/exchange/ops.TestFunc[example/exchange.Model, string], example/identity/email.Client, example/identity/users.Client +example/exchange/ops.Backends[6]: *example/exchange/db.ExchangeDB, *example/external/versioned/v1.Service, chan<- example/exchange.Model, example/exchange/ops.GenericStringType, example/identity/email.Client, example/identity/users.Client diff --git a/internal/testdata/dev_exchange_tpldata.golden b/internal/testdata/dev_exchange_tpldata.golden index 97217ca..f4afea1 100644 --- a/internal/testdata/dev_exchange_tpldata.golden +++ b/internal/testdata/dev_exchange_tpldata.golden @@ -92,7 +92,7 @@ deps: returnserr: true params: [] errwrapmsg: exchange db connect - - type: exchange_ops.TestFunc[exchange.Model, string] + - type: exchange_ops.GenericStringType var: genericStringFunc getter: GenericStringFunc isduplicate: false diff --git a/internal/testdata/dev_exchange_weldoutput.golden b/internal/testdata/dev_exchange_weldoutput.golden index 72c8aae..23a61ef 100644 --- a/internal/testdata/dev_exchange_weldoutput.golden +++ b/internal/testdata/dev_exchange_weldoutput.golden @@ -65,7 +65,7 @@ type backendsImpl struct { email email.Client emailDB *email_db.EmailDB exchangeDB *exchange_db.ExchangeDB - genericStringFunc exchange_ops.TestFunc[exchange.Model, string] + genericStringFunc exchange_ops.GenericStringType modelChan chan<- exchange.Model users users.Client usersDB *users_db.UsersDB @@ -84,7 +84,7 @@ func (b *backendsImpl) ExchangeDB() *exchange_db.ExchangeDB { return b.exchangeDB } -func (b *backendsImpl) GenericStringFunc() exchange_ops.TestFunc[exchange.Model, string] { +func (b *backendsImpl) GenericStringFunc() exchange_ops.GenericStringType { return b.genericStringFunc } diff --git a/internal/testdata/example/duplicate/state/backends_gen.go b/internal/testdata/example/duplicate/state/backends_gen.go new file mode 100644 index 0000000..06a1ebb --- /dev/null +++ b/internal/testdata/example/duplicate/state/backends_gen.go @@ -0,0 +1,8 @@ +package state + +// Code generated by weld. DO NOT EDIT. + +type Backends interface { + Foo() FooSomething + GetFoo() FooSomething +} diff --git a/internal/testdata/example/duplicate/state/weld_gen.go b/internal/testdata/example/duplicate/state/weld_gen.go new file mode 100644 index 0000000..266980a --- /dev/null +++ b/internal/testdata/example/duplicate/state/weld_gen.go @@ -0,0 +1,27 @@ +//go:build !dev + +package state + +// Code generated by weld. DO NOT EDIT. + +func MakeBackends() (Backends, error) { + var ( + b backendsImpl + ) + + b.foo = FooProvider() + + return &b, nil +} + +type backendsImpl struct { + foo FooSomething +} + +func (b *backendsImpl) Foo() FooSomething { + return b.foo +} + +func (b *backendsImpl) GetFoo() FooSomething { + return b.foo +} diff --git a/internal/testdata/example/exchange/state/devstate/weld_gen.go b/internal/testdata/example/exchange/state/devstate/weld_gen.go index 72c8aae..23a61ef 100644 --- a/internal/testdata/example/exchange/state/devstate/weld_gen.go +++ b/internal/testdata/example/exchange/state/devstate/weld_gen.go @@ -65,7 +65,7 @@ type backendsImpl struct { email email.Client emailDB *email_db.EmailDB exchangeDB *exchange_db.ExchangeDB - genericStringFunc exchange_ops.TestFunc[exchange.Model, string] + genericStringFunc exchange_ops.GenericStringType modelChan chan<- exchange.Model users users.Client usersDB *users_db.UsersDB @@ -84,7 +84,7 @@ func (b *backendsImpl) ExchangeDB() *exchange_db.ExchangeDB { return b.exchangeDB } -func (b *backendsImpl) GenericStringFunc() exchange_ops.TestFunc[exchange.Model, string] { +func (b *backendsImpl) GenericStringFunc() exchange_ops.GenericStringType { return b.genericStringFunc } diff --git a/internal/testdata/example/exchange/state/weld_gen.go b/internal/testdata/example/exchange/state/weld_gen.go index d2cd48f..03c4206 100644 --- a/internal/testdata/example/exchange/state/weld_gen.go +++ b/internal/testdata/example/exchange/state/weld_gen.go @@ -51,7 +51,7 @@ func MakeBackends() (exchange_ops.Backends, error) { type backendsImpl struct { email email.Client exchangeDB *exchange_db.ExchangeDB - genericStringFunc exchange_ops.TestFunc[exchange.Model, string] + genericStringFunc exchange_ops.GenericStringType modelChan chan<- exchange.Model users users.Client versioned *versioned_v1.Service @@ -65,7 +65,7 @@ func (b *backendsImpl) ExchangeDB() *exchange_db.ExchangeDB { return b.exchangeDB } -func (b *backendsImpl) GenericStringFunc() exchange_ops.TestFunc[exchange.Model, string] { +func (b *backendsImpl) GenericStringFunc() exchange_ops.GenericStringType { return b.genericStringFunc } diff --git a/internal/testdata/example/no_err/state/backends_gen.go b/internal/testdata/example/no_err/state/backends_gen.go new file mode 100644 index 0000000..b9dd48b --- /dev/null +++ b/internal/testdata/example/no_err/state/backends_gen.go @@ -0,0 +1,7 @@ +package state + +// Code generated by weld. DO NOT EDIT. + +type Backends interface { + Foo() bool +} diff --git a/internal/testdata/example/no_err/state/weld_gen.go b/internal/testdata/example/no_err/state/weld_gen.go new file mode 100644 index 0000000..23fc603 --- /dev/null +++ b/internal/testdata/example/no_err/state/weld_gen.go @@ -0,0 +1,23 @@ +//go:build !dev + +package state + +// Code generated by weld. DO NOT EDIT. + +func MakeBackends() (Backends, error) { + var ( + b backendsImpl + ) + + b.foo = foo() + + return &b, nil +} + +type backendsImpl struct { + foo bool +} + +func (b *backendsImpl) Foo() bool { + return b.foo +} diff --git a/internal/testdata/example/samevar/state/backends_gen.go b/internal/testdata/example/samevar/state/backends_gen.go new file mode 100644 index 0000000..42bd35d --- /dev/null +++ b/internal/testdata/example/samevar/state/backends_gen.go @@ -0,0 +1,12 @@ +package state + +// Code generated by weld. DO NOT EDIT. + +import ( + "example/samevar/pool" +) + +type Backends interface { + GetPool() *pool.BarPool + Pool() *pool.FooPool +} diff --git a/internal/testdata/example/samevar/state/weld_gen.go b/internal/testdata/example/samevar/state/weld_gen.go new file mode 100644 index 0000000..c8bb61f --- /dev/null +++ b/internal/testdata/example/samevar/state/weld_gen.go @@ -0,0 +1,32 @@ +package state + +// Code generated by weld. DO NOT EDIT. + +import ( + "example/samevar/pool" +) + +func MakeBackends() (Backends, error) { + var ( + b backendsImpl + ) + + b.pool = pool.NewBarPool() + + b.pool1 = pool.NewFooPool() + + return &b, nil +} + +type backendsImpl struct { + pool *pool.BarPool + pool1 *pool.FooPool +} + +func (b *backendsImpl) GetPool() *pool.BarPool { + return b.pool +} + +func (b *backendsImpl) Pool() *pool.FooPool { + return b.pool1 +} diff --git a/internal/testdata/example/sort_with_bind/state/backends_gen.go b/internal/testdata/example/sort_with_bind/state/backends_gen.go new file mode 100644 index 0000000..cd19290 --- /dev/null +++ b/internal/testdata/example/sort_with_bind/state/backends_gen.go @@ -0,0 +1,13 @@ +package state + +// Code generated by weld. DO NOT EDIT. + +import ( + "example/sort_with_bind" +) + +type Backends interface { + GetFoo() sort_with_bind.Foo + GetBar() sort_with_bind.Bar + GetBaz() sort_with_bind.Baz +} diff --git a/internal/testdata/example/sort_with_bind/state/weld_gen.go b/internal/testdata/example/sort_with_bind/state/weld_gen.go new file mode 100644 index 0000000..07464ce --- /dev/null +++ b/internal/testdata/example/sort_with_bind/state/weld_gen.go @@ -0,0 +1,40 @@ +package state + +// Code generated by weld. DO NOT EDIT. + +import ( + "example/sort_with_bind" + "example/sort_with_bind/providers" +) + +func MakeBackends() (Backends, error) { + var ( + b backendsImpl + ) + + b.foo = providers.NewFoo() + + b.bar = providers.NewBar(b.foo) + + b.baz = providers.NewBaz(b.bar) + + return &b, nil +} + +type backendsImpl struct { + foo sort_with_bind.Foo + bar sort_with_bind.Bar + baz sort_with_bind.Baz +} + +func (b *backendsImpl) GetFoo() sort_with_bind.Foo { + return b.foo +} + +func (b *backendsImpl) GetBar() sort_with_bind.Bar { + return b.bar +} + +func (b *backendsImpl) GetBaz() sort_with_bind.Baz { + return b.baz +} diff --git a/internal/testdata/example/transitive/state/backends_gen.go b/internal/testdata/example/transitive/state/backends_gen.go new file mode 100644 index 0000000..138b4aa --- /dev/null +++ b/internal/testdata/example/transitive/state/backends_gen.go @@ -0,0 +1,14 @@ +package state + +// Code generated by weld. DO NOT EDIT. + +import ( + transitive_ops "example/transitive/ops" +) + +type Backends interface { + Foo() transitive_ops.Foo + Qux() transitive_ops.Qux + Bar() transitive_ops.Bar + Baz() transitive_ops.Baz +} diff --git a/internal/testdata/example/transitive/state/testing_gen.go b/internal/testdata/example/transitive/state/testing_gen.go new file mode 100644 index 0000000..93aedcd --- /dev/null +++ b/internal/testdata/example/transitive/state/testing_gen.go @@ -0,0 +1,93 @@ +//go:build !dev + +package state + +// Code generated by weld. DO NOT EDIT. + +import ( + transitive_ops "example/transitive/ops" + "testing" +) + +func NewTestingBackends(b Backends) *TestingBackends { + return &TestingBackends{ + Backends: b, + } +} + +type TestingBackends struct { + Backends + + foo transitive_ops.Foo + qux transitive_ops.Qux + bar transitive_ops.Bar + baz transitive_ops.Baz +} + +func (ti *TestingBackends) Foo() transitive_ops.Foo { + if ti.foo != nil { + return ti.foo + } + + return ti.Backends.Foo() +} + +func (ti *TestingBackends) Qux() transitive_ops.Qux { + if ti.qux != nil { + return ti.qux + } + + return ti.Backends.Qux() +} + +func (ti *TestingBackends) Bar() transitive_ops.Bar { + if ti.bar != nil { + return ti.bar + } + + return ti.Backends.Bar() +} + +func (ti *TestingBackends) Baz() transitive_ops.Baz { + if ti.baz != nil { + return ti.baz + } + + return ti.Backends.Baz() +} + +// SetFooForTesting is a runtime available override for the "foo" dependency that should only be used for testing. +func (ti *TestingBackends) SetFooForTesting(t *testing.T, foo transitive_ops.Foo) { + t.Cleanup(func() { + ti.foo = nil + }) + + ti.foo = foo +} + +// SetQuxForTesting is a runtime available override for the "qux" dependency that should only be used for testing. +func (ti *TestingBackends) SetQuxForTesting(t *testing.T, qux transitive_ops.Qux) { + t.Cleanup(func() { + ti.qux = nil + }) + + ti.qux = qux +} + +// SetBarForTesting is a runtime available override for the "bar" dependency that should only be used for testing. +func (ti *TestingBackends) SetBarForTesting(t *testing.T, bar transitive_ops.Bar) { + t.Cleanup(func() { + ti.bar = nil + }) + + ti.bar = bar +} + +// SetBazForTesting is a runtime available override for the "baz" dependency that should only be used for testing. +func (ti *TestingBackends) SetBazForTesting(t *testing.T, baz transitive_ops.Baz) { + t.Cleanup(func() { + ti.baz = nil + }) + + ti.baz = baz +} diff --git a/internal/testdata/example/transitive/state/weld_gen.go b/internal/testdata/example/transitive/state/weld_gen.go new file mode 100644 index 0000000..93438c5 --- /dev/null +++ b/internal/testdata/example/transitive/state/weld_gen.go @@ -0,0 +1,57 @@ +//go:build !dev + +package state + +// Code generated by weld. DO NOT EDIT. + +import ( + transitive_ops "example/transitive/ops" + + "github.com/luno/jettison/errors" +) + +func MakeBackends() (Backends, error) { + var ( + b backendsImpl + err error + ) + + b.foo, err = transitive_ops.NewFoo() + if err != nil { + return nil, errors.Wrap(err, "transitive ops new foo") + } + + b.qux, err = transitive_ops.NewQux() + if err != nil { + return nil, errors.Wrap(err, "transitive ops new qux") + } + + b.bar = transitive_ops.NewBar(b.foo) + + b.baz = transitive_ops.NewBaz(b.bar, b.qux) + + return &b, nil +} + +type backendsImpl struct { + foo transitive_ops.Foo + qux transitive_ops.Qux + bar transitive_ops.Bar + baz transitive_ops.Baz +} + +func (b *backendsImpl) Foo() transitive_ops.Foo { + return b.foo +} + +func (b *backendsImpl) Qux() transitive_ops.Qux { + return b.qux +} + +func (b *backendsImpl) Bar() transitive_ops.Bar { + return b.bar +} + +func (b *backendsImpl) Baz() transitive_ops.Baz { + return b.baz +} diff --git a/internal/testdata/example/variadic/state/backends_gen.go b/internal/testdata/example/variadic/state/backends_gen.go new file mode 100644 index 0000000..dc6a701 --- /dev/null +++ b/internal/testdata/example/variadic/state/backends_gen.go @@ -0,0 +1,11 @@ +package state + +// Code generated by weld. DO NOT EDIT. + +import ( + variadic_ops "example/variadic/ops" +) + +type Backends interface { + Foo() variadic_ops.Foo +} diff --git a/internal/testdata/example/variadic/state/weld_gen.go b/internal/testdata/example/variadic/state/weld_gen.go new file mode 100644 index 0000000..ce1bf91 --- /dev/null +++ b/internal/testdata/example/variadic/state/weld_gen.go @@ -0,0 +1,32 @@ +package state + +// Code generated by weld. DO NOT EDIT. + +import ( + variadic_ops "example/variadic/ops" + "testing" + + "github.com/luno/jettison/errors" +) + +func MakeBackends(t *testing.T) (Backends, error) { + var ( + b backendsImpl + err error + ) + + b.foo, err = variadic_ops.NewFooForTesting(t) + if err != nil { + return nil, errors.Wrap(err, "variadic ops new foo for testing") + } + + return &b, nil +} + +type backendsImpl struct { + foo variadic_ops.Foo +} + +func (b *backendsImpl) Foo() variadic_ops.Foo { + return b.foo +} diff --git a/internal/testdata/exchange_graph.golden b/internal/testdata/exchange_graph.golden index 0f6771b..a7456cb 100644 --- a/internal/testdata/exchange_graph.golden +++ b/internal/testdata/exchange_graph.golden @@ -20,4 +20,4 @@ Set[14]: (inline) Func[1]: func example/external/mail.New(opts ...example/external/mail.option) (*example/external/mail.Mailer, error) Func[1]: func example/external/mail/mail.New() (*example/external/mail/mail.MailerLegacy, error) Func[1]: func example/external/versioned.New() *example/external/versioned/v1.Service - Func[1]: func example/exchange/state.NewGenericStringType() example/exchange/ops.TestFunc[example/exchange.Model, string] + Func[1]: func example/exchange/state.NewGenericStringType() example/exchange/ops.GenericStringType diff --git a/internal/testdata/exchange_selected.golden b/internal/testdata/exchange_selected.golden index c1340df..1f28250 100644 --- a/internal/testdata/exchange_selected.golden +++ b/internal/testdata/exchange_selected.golden @@ -1,7 +1,7 @@ Func[1]: func example/exchange/db.Connect() (*example/exchange/db.ExchangeDB, error) Func[1]: func example/external/versioned.New() *example/external/versioned/v1.Service Func[1]: func example/exchange/state.NewModelChan() chan<- example/exchange.Model -Func[1]: func example/exchange/state.NewGenericStringType() example/exchange/ops.TestFunc[example/exchange.Model, string] +Func[1]: func example/exchange/state.NewGenericStringType() example/exchange/ops.GenericStringType Bind[1]: example/identity/email.Client(*example/identity/email/client/grpc.client) Bind[1]: example/identity/users.Client(*example/identity/users/client/grpc.client) Func[1]: func example/identity/email/client/grpc.New() (*example/identity/email/client/grpc.client, error) diff --git a/internal/testdata/exchange_specBack.golden b/internal/testdata/exchange_specBack.golden index 5b920a3..8084a38 100644 --- a/internal/testdata/exchange_specBack.golden +++ b/internal/testdata/exchange_specBack.golden @@ -1 +1 @@ -example/exchange/ops.Backends[6]: *example/exchange/db.ExchangeDB, *example/external/versioned/v1.Service, chan<- example/exchange.Model, example/exchange/ops.TestFunc[example/exchange.Model, string], example/identity/email.Client, example/identity/users.Client +example/exchange/ops.Backends[6]: *example/exchange/db.ExchangeDB, *example/external/versioned/v1.Service, chan<- example/exchange.Model, example/exchange/ops.GenericStringType, example/identity/email.Client, example/identity/users.Client diff --git a/internal/testdata/exchange_tpldata.golden b/internal/testdata/exchange_tpldata.golden index ec8d838..c673670 100644 --- a/internal/testdata/exchange_tpldata.golden +++ b/internal/testdata/exchange_tpldata.golden @@ -61,7 +61,7 @@ deps: returnserr: true params: [] errwrapmsg: exchange db connect - - type: exchange_ops.TestFunc[exchange.Model, string] + - type: exchange_ops.GenericStringType var: genericStringFunc getter: GenericStringFunc isduplicate: false diff --git a/internal/testdata/exchange_weldoutput.golden b/internal/testdata/exchange_weldoutput.golden index d2cd48f..03c4206 100644 --- a/internal/testdata/exchange_weldoutput.golden +++ b/internal/testdata/exchange_weldoutput.golden @@ -51,7 +51,7 @@ func MakeBackends() (exchange_ops.Backends, error) { type backendsImpl struct { email email.Client exchangeDB *exchange_db.ExchangeDB - genericStringFunc exchange_ops.TestFunc[exchange.Model, string] + genericStringFunc exchange_ops.GenericStringType modelChan chan<- exchange.Model users users.Client versioned *versioned_v1.Service @@ -65,7 +65,7 @@ func (b *backendsImpl) ExchangeDB() *exchange_db.ExchangeDB { return b.exchangeDB } -func (b *backendsImpl) GenericStringFunc() exchange_ops.TestFunc[exchange.Model, string] { +func (b *backendsImpl) GenericStringFunc() exchange_ops.GenericStringType { return b.genericStringFunc }