diff options
| author | Paul Buetow <paul@buetow.org> | 2023-07-02 20:10:38 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-07-02 20:10:38 +0300 |
| commit | 9e099d15bd31f80751b9b2ac38c31bf130528329 (patch) | |
| tree | 118d42839d53a237ea64658229ab9c9762c4f35a /internal/vote | |
| parent | 5978480b49c152e458055bb3a6b1b4ba9afa54e9 (diff) | |
refactor config to use functional options pattern
Diffstat (limited to 'internal/vote')
| -rw-r--r-- | internal/vote/vote_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/vote/vote_test.go b/internal/vote/vote_test.go index a546a2b..f1221b2 100644 --- a/internal/vote/vote_test.go +++ b/internal/vote/vote_test.go @@ -10,7 +10,7 @@ import ( func TestVote(t *testing.T) { t.Parallel() - conf, _ := config.NewFromConfig(config.Config{MyID: "foo.zone"}) + conf, _ := config.New(config.WithMyID("foo.zone")) v, _ := New(conf, []string{"foo", "bar", "baz", "bay"}) if v.FromID != "foo.zone" { @@ -33,7 +33,7 @@ func TestVote(t *testing.T) { func TestVoteExpiry(t *testing.T) { t.Parallel() - conf, _ := config.NewFromConfig(config.Config{MyID: "foo.zone"}) + conf, _ := config.New(config.WithMyID("foo.zone")) v, _ := New(conf, []string{"foo", "bar", "baz", "bay"}) // Set expiry 1h into the future @@ -52,7 +52,7 @@ func TestVoteExpiry(t *testing.T) { func TestMarshalling(t *testing.T) { t.Parallel() - conf, _ := config.NewFromConfig(config.Config{MyID: "foo.zone"}) + conf, _ := config.New(config.WithMyID("foo.zone")) v, _ := New(conf, []string{"foo", "bar", "baz", "bay"}) jsonStr, err := v.ToJSON() |
