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
+36.3k Golang : How to split or chunking a file to smaller pieces?
+10.5k Swift : Convert (cast) String to Integer
+5.3k Javascript : Shuffle or randomize array example
+6.8k Unix/Linux : How to fix CentOS yum duplicate glibc or device-mapper-libs dependency error?
+10.3k Golang : How to check if a website is served via HTTPS
+14.2k Golang : Fix image: unknown format error
+13.1k Golang : How to get a user home directory path?
+27.7k PHP : Count number of JSON items/objects
+15.3k nginx: [emerg] unknown directive "ssl"
+7.1k Restart Apache or Nginx web server without password prompt
+6.3k Golang : Calculate US Dollar Index (DXY)
+14.4k Golang : Parsing or breaking down URL