🚧 Pass Config to generator

This commit is contained in:
Dan Jones 2025-03-13 15:36:30 -05:00
commit 921020d9fd
6 changed files with 31 additions and 31 deletions

View file

@ -8,7 +8,7 @@ import (
)
func TestMake(t *testing.T) {
genOpt := WithGenerator(func() (string, error) { return "abc", nil })
genOpt := WithGenerator(func(*Config) (string, error) { return "abc", nil })
testcases := []struct {
name string
opts []Option
@ -47,7 +47,7 @@ func TestMake(t *testing.T) {
func TestMakeErr(t *testing.T) {
retErr := errors.New("oops")
conf := NewConfig(WithGenerator(func() (string, error) { return "foobar", retErr }))
conf := NewConfig(WithGenerator(func(*Config) (string, error) { return "foobar", retErr }))
st, err := Make(conf)
assert.Zero(t, st)
assert.ErrorIs(t, err, retErr)