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
+11.1k Golang : Web routing/multiplex example
+7.1k Golang : A simple forex opportunities scanner
+14.3k Golang : Get uploaded file name or access uploaded files
+10.2k Golang : Find and replace data in all files recursively
+10.2k Golang : Random Rune generator
+10.2k Golang : Use regular expression to get all upper case or lower case characters example
+9.5k Golang : Detect Pascal, Kebab, Screaming Snake and Camel cases
+9.3k Golang : Temperatures conversion example
+13.4k Golang : Read from buffered reader until specific number of bytes
+9.7k Random number generation with crypto/rand in Go
+40.1k Golang : UDP client server read write example