Arch
Overview
Arch returns the architecture (runtime.GOARCH).
If you are coming from Node.js, the closest pattern is process.arch.
Signature
go
func Arch() stringCompare: Node.js · Standard Go · gox
js
process.archgo
val, err := os.Arch()go
import "github.com/sahilkhaire/gox/osutil"
osutil.Arch()Example
go
import "github.com/sahilkhaire/gox/osutil"
osutil.Arch()Tips
Import github.com/sahilkhaire/gox/osutil and call Arch directly. See the comparison below for the standard library equivalent.
Standard library alternative
Use the standard library directly:
go
val, err := os.Arch()