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.9k Golang : Trim everything onward after a word
+5.8k Golang : Launching your executable inside a console under Linux
+14.5k Golang : Overwrite previous output with count down timer
+4.4k Linux/MacOSX : Search and delete files by extension
+17.7k How to enable MariaDB/MySQL logs ?
+9.8k Golang : Format strings to SEO friendly URL example
+12.8k Golang : Listen and Serve on sub domain example
+28.2k Golang : Connect to database (MySQL/MariaDB) server
+9.5k Golang : Extract or copy items from map based on value
+5.8k Golang : Find change in a combination of coins example
+10.3k Golang : Convert file unix timestamp to UTC time example