internal/server: only use non-nil tags (#4996)
This commit is contained in:
1 parent
5707a64b20
commit
a77769fdb6
2 files changed
+3
-2
No files matched your search
@@ -129,7 +129,7 @@ func WithWorkerTags(tags ...*Tag) Option {
|
||||
}
|
||||
}
|
||||
if len(newTags) > 0 {
|
||||
o.withWorkerTags = tags
|
||||
o.withWorkerTags = newTags
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user