Golang go/build.ArchChar() function example
package go/build
ArchChar returns the architecture character for the given goarch. For example, ArchChar("amd64") returns "6".
Golang go/build.ArchChar() function usage example
// Go compiler path
var gcPath string
// determine compiler
var gc string
switch runtime.GOARCH {
case "386":
gc = "8g"
case "amd64":
gc = "6g"
case "arm":
gc = "5g"
default:
gcPath = "unknown-GOARCH-compiler"
return
}
archCh, _ := build.ArchChar(runtime.GOARCH)
Reference :
Advertisement
Something interesting
Tutorials
+7.5k Gogland : Single File versus Go Application Run Configurations
+4.1k Javascript : Empty an array example
+11.8k Golang : GTK Input dialog box examples
+6.7k Golang : Skip or discard items of non-interest when iterating example
+22.1k Golang : Join arrays or slices example
+23.5k Golang : Check if element exist in map
+5.4k Golang *File points to a file or directory ?
+10.6k Golang : Bubble sort example
+7.1k Golang : Transform lisp or spinal case to Pascal case example
+10.2k Golang : How to profile or log time spend on execution?
+6.9k Mac/Linux/Windows : Get CPU information from command line
+9.4k Golang : Detect Pascal, Kebab, Screaming Snake and Camel cases