From 99f8eb08bdca46925e5a00d4dda4d9625694b86b Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 7 Oct 2025 06:28:53 -0500 Subject: find more valid package names --- wit.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'wit.go') diff --git a/wit.go b/wit.go index 124404f..a364de3 100644 --- a/wit.go +++ b/wit.go @@ -91,11 +91,22 @@ func (m *Machine) FindByVersion(name string, version string) *Package { if name == p.Name { if version == "" { return p - } else { - if version == p.Version { - return p - } } + if strings.HasPrefix(p.Version, version+"-") { + return p + } + if strings.HasPrefix(p.Version, version+".") { + return p + } + if version == p.Version { + return p + } + } + } + // give anything with the same name + for p := range m.Wit.IterByName() { + if name == p.Name { + return p } } -- cgit v1.2.3