aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/rosa.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/rosa/rosa.go')
-rw-r--r--internal/rosa/rosa.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go
index 560f10d5..930a1896 100644
--- a/internal/rosa/rosa.go
+++ b/internal/rosa/rosa.go
@@ -69,6 +69,18 @@ func triplet() string {
return linuxArch() + "-rosa-linux-musl"
}
+// perArch is a value that differs per architecture.
+type perArch[T any] map[string]T
+
+// unwrap returns the value for the current architecture.
+func (p perArch[T]) unwrap() T {
+ v, ok := p[runtime.GOARCH]
+ if !ok {
+ panic("unsupported target " + runtime.GOARCH)
+ }
+ return v
+}
+
const (
// EnvTriplet holds the return value of triplet.
EnvTriplet = "ROSA_TRIPLE"