From 861a911315dc77427ad794fb3cae51b693eec500 Mon Sep 17 00:00:00 2001 From: Alex Goodman Date: Fri, 14 Jun 2024 09:08:42 -0400 Subject: [PATCH] loosen ld flag parsing requirements Signed-off-by: Alex Goodman --- syft/pkg/cataloger/golang/parse_go_binary.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syft/pkg/cataloger/golang/parse_go_binary.go b/syft/pkg/cataloger/golang/parse_go_binary.go index e538937054c..88600355cc7 100644 --- a/syft/pkg/cataloger/golang/parse_go_binary.go +++ b/syft/pkg/cataloger/golang/parse_go_binary.go @@ -38,8 +38,8 @@ var ( // inject the correct version into the main module of the build process knownBuildFlagPatterns = []*regexp.Regexp{ - regexp.MustCompile(`(?m)\.(TiDB)?([gG]it)?([bB]uild)?([rR]elease)?[vV]er(sion)?=(\S+/)*(?Pv?\d+.\d+.\d+[-\w]*)`), - regexp.MustCompile(`(?m)\.([tT]ag)=(\S+/)*(?Pv?\d+.\d+.\d+[-\w]*)`), + regexp.MustCompile(`(?m)\.[a-zA-Z0-9]*([rR]elease)?([gG]it)?([bB]uild)?[vV]er(sion)?=(\S+/)*(?Pv?\d+.\d+.\d+[-\w]*)`), + regexp.MustCompile(`(?m)\.[a-zA-Z0-9]*([tT]ag)=(\S+/)*(?Pv?\d+.\d+.\d+[-\w]*)`), } )