testjobqueue: initialize dependants map

Adding to a nil map leads to panic. We must ensure that all maps are
initialized before use.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2020-08-16 17:26:12 +02:00 committed by Lars Karlitski
parent 23dc0a2c28
commit f355bdd426

View file

@ -38,8 +38,9 @@ type job struct {
func New() *testJobQueue {
return &testJobQueue{
jobs: make(map[uuid.UUID]*job),
pending: make(map[string][]uuid.UUID),
jobs: make(map[uuid.UUID]*job),
pending: make(map[string][]uuid.UUID),
dependants: make(map[uuid.UUID][]uuid.UUID),
}
}