Content-Length: 245993 | pFad | http://github.com/sxmbaka/go-plgrd/blob/main/go-runtime-env-vars/GOOS-GOARCH.md

90 go-plgrd/go-runtime-env-vars/GOOS-GOARCH.md at main · sxmbaka/go-plgrd · GitHub
Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 678 Bytes

GOOS-GOARCH.md

File metadata and controls

12 lines (8 loc) · 678 Bytes

GOOS and GOARCH

Purpose: These variables are used when cross-compiling Go code for different operating systems and architectures.

Usage: Set GOOS to your target operating system (e.g., "linux," "windows," "darwin") and GOARCH to your target architecture (e.g., "amd64," "arm") when running the go build or go install command.

Benefits: Cross-Platform Compatibility — These variables allow you to compile your Go code for different operating systems and architectures, increasing the portability of your applications.

# Cross-compile for Linux on a Windows machine (GOOS=linux, GOARCH=amd64)
GOOS=linux GOARCH=amd64 go build -o myapp-linux main.go








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/sxmbaka/go-plgrd/blob/main/go-runtime-env-vars/GOOS-GOARCH.md

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy