Initialize platform matchers for current platform

Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
This commit is contained in:
James Sturtevant
2022-01-28 21:48:49 -08:00
parent 2a588a619e
commit 83c80388b2
5 changed files with 191 additions and 32 deletions

View File

@@ -136,9 +136,7 @@ type Matcher interface {
//
// Applications should opt to use `Match` over directly parsing specifiers.
func NewMatcher(platform specs.Platform) Matcher {
return &matcher{
Platform: Normalize(platform),
}
return newDefaultMatcher(platform)
}
type matcher struct {
@@ -257,5 +255,6 @@ func Format(platform specs.Platform) string {
func Normalize(platform specs.Platform) specs.Platform {
platform.OS = normalizeOS(platform.OS)
platform.Architecture, platform.Variant = normalizeArch(platform.Architecture, platform.Variant)
return platform
}