From a49df76d0ec125f1623805f7558bef09354cc7d6 Mon Sep 17 00:00:00 2001 From: Mike Bijon Date: Tue, 18 Feb 2020 12:43:13 -0800 Subject: [PATCH] Adding CLI commands for Windows cmd.exe, if PowerShell not available --- WindowsCrossCompiling.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/WindowsCrossCompiling.md b/WindowsCrossCompiling.md index 9bc9c752..b67aa5b7 100644 --- a/WindowsCrossCompiling.md +++ b/WindowsCrossCompiling.md @@ -20,6 +20,14 @@ func main() { $ GOOS=windows GOARCH=386 go build -o hello.exe hello.go ``` +In cmd.exe instead of PowerShell: + +```go +$ set GOOS=windows +$ set GOARCH=386 +$ go build -o hello.exe hello.go +``` + You can now run `hello.exe` on a Windows machine near you. Note that the command above will silently rebuild most of standard library, and for this reason will be quite slow. To speed-up the process, you can install all the windows-amd64 standard packages on your system with