Check "[Windows] How to tell if the exe is x64 or x86 Part2" on MacOS Go

Haruka Saho's blog post "[[Windows] How to tell if the exe is x64 or x86 Part2](http://h-sao.com/blog/2020/11/07/how-to-check" -x64-or-x86-windows-binary-part2 /) "was checked with Go.

Go can be cross-compiled. I was able to confirm it in about 20 minutes from the tweet posted on the blog article.

    1. Write Go source code for x64 (amd64) and x32 (386). (The only difference is the output message)
$ cat main64.go 
package main

import (
	"fmt"
)

func main() {
	fmt.Println("GOOS=windows GOARCH=amd64")
}
$ cat main32.go 
package main

import (
	"fmt"
)

func main() {
	fmt.Println("GOOS=windows GOARCH=386")
}
  1. Compile Go source code on macOS with x64 (amd64) and x32 (386).
$ GOOS=windows GOARCH=amd64 go build -o main64.exe main64.go 
$ GOOS=windows GOARCH=386 go build -o main32.exe main32.go
    1. Confirm file generation.
$ ls main*
main32.exe main32.go  main64.exe main64.go
  1. Confirm with the file command.
$ file main32.exe 
main32.exe: PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows
$ file main64.exe
main64.exe: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows

You did it! q @ w @ p

Recommended Posts

Check "[Windows] How to tell if the exe is x64 or x86 Part2" on MacOS Go
Check if the LAN cable is disconnected on Linux
How to enjoy Python on Android !! Programming on the go !!
How to use any or all to check if it is in a dictionary (Hash)
How to check in Python if one of the elements of a list is in another list
[python] How to check if the Key exists in the dictionary
[Blender] Script to check if the selected one is a mesh
A note on how to check the connection to the license server port
How easy is it to synthesize a drug on the market?
What to do if the inode is exhausted on EC2 Linux
How to install graph-tool on macOS
How to install pycrypto on Windows
How to deploy django-compressor on Windows
How to install Go on Ubuntu
How to install music 21 on windows
[For Numba beginners] It is better to set nopython = True to check if the speedup is realized (for version 0.50.0 or earlier)
How to check the version of Django
[Kivy] How to install Kivy on Windows [Python]
How to use Google Assistant on Windows 10
How to erase Python 2.x on Mac.
How to install richzhang / colorization on Windows 10
How to install cx_Oracle on macOS Sierra
What to do if CERTIFICATE_VERIFY_FAILED occurs when nltk.download () is done on macOS pyhon
How to quickly install h5py on Windows 10 [Unofficial]
[Algorithm x Python] How to use the list
How to live a decent life on 2017 Windows
The .pyd file is the DLL itself on Windows
[Python] How to install OpenCV on Anaconda [Windows]
[Go] How to write or call a function
How to install / verify graphviz on anaconda / windows10
Create a python script to check if the link at the specified URL is valid 2
Create a python script to check if the link at the specified URL is valid
What to do if Python IntelliSense is not displayed in VS Code on Windows