diff --git a/yo.go b/yo.go index 2f0ba0f..44c155c 100644 --- a/yo.go +++ b/yo.go @@ -24,9 +24,9 @@ type Yoable[Y any] interface { type Opt[T Yoable[T]] func(*Model[T]) // WithSpannerClientOption returns an Opt that sets the spanner client. -func WithSpannerClientOption[T Yoable[T]](c spanner.Client) Opt[T] { +func WithSpannerClientOption[T Yoable[T]](c *spanner.Client) Opt[T] { return func(m *Model[T]) { - m.Client = c + m.Client = *c } } diff --git a/yo_test.go b/yo_test.go index af5015e..0016f24 100644 --- a/yo_test.go +++ b/yo_test.go @@ -179,7 +179,7 @@ func TestModel_Apply(t *testing.T) { defer cleanup() m := NewModel(tt.fields.model, - WithSpannerClientOption[*user.User](*spannerClient), + WithSpannerClientOption[*user.User](spannerClient), ) before, after := tt.mutType.Hooks()