diff --git a/internal/server/options.go b/internal/server/options.go index f737d2f90..205e76512 100644 --- a/internal/server/options.go +++ b/internal/server/options.go @@ -129,7 +129,7 @@ func WithWorkerTags(tags ...*Tag) Option { } } if len(newTags) > 0 { - o.withWorkerTags = tags + o.withWorkerTags = newTags } } } diff --git a/internal/server/options_test.go b/internal/server/options_test.go index aae84a9c4..cb4e620d6 100644 --- a/internal/server/options_test.go +++ b/internal/server/options_test.go @@ -77,10 +77,11 @@ func Test_GetOpts(t *testing.T) { tags := []*Tag{ {Key: "key1", Value: "val1"}, {Key: "key2", Value: "val2"}, + nil, } opts := GetOpts(WithWorkerTags(tags...)) testOpts := getDefaultOptions() - testOpts.withWorkerTags = tags + testOpts.withWorkerTags = tags[:2] opts.withNewIdFunc = nil testOpts.withNewIdFunc = nil assert.Equal(t, opts, testOpts)