mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-01 00:23:56 +08:00 
			
		
		
		
	platformutil: add local platform
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
		| @@ -22,7 +22,7 @@ func Parse(platformsStr []string) ([]specs.Platform, error) { | ||||
| 			out = append(out, p...) | ||||
| 			continue | ||||
| 		} | ||||
| 		p, err := platforms.Parse(s) | ||||
| 		p, err := parse(s) | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -31,6 +31,13 @@ func Parse(platformsStr []string) ([]specs.Platform, error) { | ||||
| 	return out, nil | ||||
| } | ||||
|  | ||||
| func parse(in string) (specs.Platform, error) { | ||||
| 	if strings.EqualFold(in, "local") { | ||||
| 		return platforms.DefaultSpec(), nil | ||||
| 	} | ||||
| 	return platforms.Parse(in) | ||||
| } | ||||
|  | ||||
| func Dedupe(in []specs.Platform) []specs.Platform { | ||||
| 	m := map[string]struct{}{} | ||||
| 	out := make([]specs.Platform, 0, len(in)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Tonis Tiigi
					Tonis Tiigi