1
0

feat: fail fast on regexp error

This commit is contained in:
dump_stack() 2023-05-15 11:50:54 +00:00
parent 883c8ee6cb
commit 562abec7f4
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -51,14 +51,17 @@ type DebianGetDebCmd struct {
}
func (cmd DebianGetDebCmd) Run() (err error) {
re, err := regexp.Compile(cmd.Regexp)
if err != nil {
log.Fatal().Err(err).Msg("regexp")
}
kernels, err := debian.GetKernels()
if err != nil {
log.Error().Err(err).Msg("")
return
}
re := regexp.MustCompile(cmd.Regexp)
var packages []snapshot.Package
for _, kernel := range kernels {
for _, pkg := range kernel.Packages() {