MCPcopy Create free account
hub / github.com/codehamr/codehamr / goreleaserMatrix

Function goreleaserMatrix

internal/update/drift_test.go:35–57  ·  view source on GitHub ↗

goreleaserMatrix is the source of truth: every os/arch goreleaser builds for.

(t *testing.T)

Source from the content-addressed store, hash-verified

33
34// goreleaserMatrix is the source of truth: every os/arch goreleaser builds for.
35func goreleaserMatrix(t *testing.T) map[platformKey]bool {
36 t.Helper()
37 raw, err := os.ReadFile(goreleaserPath)
38 if err != nil {
39 t.Fatalf("read %s: %v", goreleaserPath, err)
40 }
41 var cfg goreleaserConfig
42 if err := yaml.Unmarshal(raw, &cfg); err != nil {
43 t.Fatalf("parse %s: %v", goreleaserPath, err)
44 }
45 m := map[platformKey]bool{}
46 for _, b := range cfg.Builds {
47 for _, goos := range b.Goos {
48 for _, goarch := range b.Goarch {
49 m[platformKey{goos, goarch}] = true
50 }
51 }
52 }
53 if len(m) == 0 {
54 t.Fatalf("%s yielded an empty build matrix - parsing broke", goreleaserPath)
55 }
56 return m
57}
58
59// assetNameSupported returns the set of platforms assetName resolves, with
60// their names. It probes a generous candidate universe UNION the matrix's own

Calls

no outgoing calls

Tested by

no test coverage detected