assetNameSupported returns the set of platforms assetName resolves, with their names. It probes a generous candidate universe UNION the matrix's own values, so every cell goreleaser builds is exercised even if it uses an os/arch the static candidate list omits.
(matrix map[platformKey]bool)
| 61 | // values, so every cell goreleaser builds is exercised even if it uses an |
| 62 | // os/arch the static candidate list omits. |
| 63 | func assetNameSupported(matrix map[platformKey]bool) map[platformKey]string { |
| 64 | osCands := map[string]bool{"linux": true, "darwin": true, "windows": true, "freebsd": true, "openbsd": true, "netbsd": true, "plan9": true, "solaris": true, "js": true, "aix": true} |
| 65 | archCands := map[string]bool{"amd64": true, "arm64": true, "386": true, "arm": true, "riscv64": true, "ppc64le": true, "s390x": true, "loong64": true, "wasm": true} |
| 66 | for k := range matrix { |
| 67 | osCands[k.os] = true |
| 68 | archCands[k.arch] = true |
| 69 | } |
| 70 | out := map[platformKey]string{} |
| 71 | for goos := range osCands { |
| 72 | for goarch := range archCands { |
| 73 | if name, ok := assetName(goos, goarch); ok { |
| 74 | out[platformKey{goos, goarch}] = name |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | return out |
| 79 | } |
| 80 | |
| 81 | // TestAssetNameMatchesGoreleaserMatrix asserts the set of platforms assetName |
| 82 | // resolves is EXACTLY the set goreleaser builds: no more, no less. Derived |
no test coverage detected