internal/server: only use non-nil tags (#4996)

This commit is contained in:
Johan Brandhorst-Satzkorn authored and GitHub committed 2024-08-06 09:17:40 -07:00
1 parent 5707a64b20
commit a77769fdb6
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -129,7 +129,7 @@ func WithWorkerTags(tags ...*Tag) Option {
}
}
if len(newTags) > 0 {
o.withWorkerTags = tags
o.withWorkerTags = newTags
}
}
}
+2 -1
View File
@@ -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)