Open ilmanzo opened 1 month ago
Opening this issue only to have your opinion, if you like the idea I will follow up with a Pull Request :)
This would be a great refactoring idea. I think the code still originates from the pre-generics time, or at least when we used a go version that didn't had generics.
Feel free to open a PR :slightly_smiling_face:
with reference to:
https://github.com/os-autoinst/openqa-mon/blob/900c7149e563b8ea972d59f22e520ea0d513a46e/cmd/openqa-mon/util.go#L44
and https://github.com/os-autoinst/openqa-mon/blob/900c7149e563b8ea972d59f22e520ea0d513a46e/cmd/openqa-mon/util.go#L56
a sample implementation with generics types (introduced in Go 1.18) that also avoids allocating a map of bools:
to call it: