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
+27.2k Golang : Find files by name - cross platform example
+22.1k Golang : Match strings by wildcard patterns with filepath.Match() function
+19.3k Golang : Get RGBA values of each image pixel
+13.6k Golang : Query string with space symbol %20 in between
+9.2k Golang : How to check if a string with spaces in between is numeric?
+6.9k Golang : How to setup a disk space used monitoring service with Telegram bot
+13.2k Golang : Skip blank/empty lines in CSV file and trim whitespaces example
+11.1k Golang : Web routing/multiplex example
+10.2k Golang : Text file editor (accept input from screen and save to file)
+7.8k Golang : Load DSA public key from file example
+6.5k Grep : How to grep for strings inside binary data
+5.1k Golang : Display packages names during compilation