Skip to content

🧩 GetArchName

Returns the current CPU architecture name.

When to Use

Use this when you need to select the correct download artifact based on architecture (amd64/arm64, etc.) or to record the runtime environment. Based on runtime.GOARCH. 🔍

Signature

go
func GetArchName() string

Parameters

ParameterTypeDescription
NonePackage-level function, takes no parameters

Return Value

  • string: Architecture identifier, e.g. amd64, arm64, 386. ✅

Example

go
package main

import (
	"fmt"

	"github.com/scagogogo/composer-skills/pkg/installer"
)

func main() {
	fmt.Printf("current architecture: %s\n", installer.GetArchName())
}

Advanced

  • This value comes directly from runtime.GOARCH. ⚙️
  • For the companion platform info, use GetPlatformName. 🖥️
  • The two combined uniquely identify the runtime environment, suitable for inclusion in diagnostic info (see GetSystemInfo). 📊

Released under the MIT License