{"id":294,"date":"2026-05-03T09:00:00","date_gmt":"2026-05-03T03:30:00","guid":{"rendered":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/"},"modified":"2026-10-10T21:21:02","modified_gmt":"2026-10-10T15:51:02","slug":"go-cross-compilation-build","status":"publish","type":"post","link":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/","title":{"rendered":"Go Cross Compilation: Build for Any OS"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Go cross compilation lets you build a program for Windows, macOS or Linux from one computer, with no extra tools. In this post, you will build for different systems and shrink your binaries. Then you will stamp a version number and write code for one system only. Also, each step comes with commands you can run.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Earlier, you first ran <code>go build<\/code> in <a href=\"https:\/\/smitabharat.com\/blog\/install-go-first-program\/\">install Go and run your first program<\/a>. We will also ship the kind of tool from <a href=\"https:\/\/smitabharat.com\/blog\/go-flag-package-cli\/\">the Go flag package lesson<\/a>. After all, people run command line tools on many systems.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Is Go Cross Compilation?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Normally, a compiler builds a program for the machine it runs on. In contrast, cross compiling means building for a different machine. For example, you can build a Windows <code>.exe<\/code> on a Linux laptop.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Still, most languages make this hard. Go, however, ships every supported target inside the normal toolchain. So you just set two environment variables, as you learned in <a href=\"https:\/\/smitabharat.com\/blog\/go-environment-variables-config\/\">Go environment variables for configuration<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GOOS and GOARCH: The Heart of Go Cross Compilation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>GOOS<\/code> picks the operating system, and <code>GOARCH<\/code> picks the processor type. For example, the diagram below shows one source folder turning into three different binaries.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-cross-compilation-build-diagram-1024x640.png\" alt=\"Go Cross Compilation diagram showing one source folder built into Windows, macOS and Linux binaries\" class=\"wp-image-279\" srcset=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-cross-compilation-build-diagram-1024x640.png 1024w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-cross-compilation-build-diagram-300x188.png 300w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-cross-compilation-build-diagram-768x480.png 768w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-cross-compilation-build-diagram-1536x960.png 1536w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-cross-compilation-build-diagram-2048x1280.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><em>One go build command with different GOOS and GOARCH values produces native binaries for Windows, macOS and Linux.<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ GOOS=windows GOARCH=amd64 go build -o hello.exe .\n$ file hello.exe\nhello.exe: PE32+ executable (console) x86-64, for MS Windows\n\n$ GOOS=darwin GOARCH=arm64 go build -o hello-mac .\n$ file hello-mac\nhello-mac: Mach-O 64-bit arm64 executable\n\n$ GOOS=linux GOARCH=arm64 go build -o hello-arm .<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Every command ran on the same Linux machine. Yet each file is a real native program for its target. In short, that is Go cross compilation in action. On Windows PowerShell, set the variables first with <code>$env:GOOS=\"linux\"<\/code> and then run <code>go build<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Common Targets<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># target                         GOOS     GOARCH\nWindows PC                       windows  amd64\nApple Silicon Mac                darwin   arm64\nIntel Mac                        darwin   amd64\nLinux server                     linux    amd64\nRaspberry Pi 4 or AWS Graviton   linux    arm64<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Also, run <code>go tool dist list<\/code> to see every pair. Go 1.24 lists 48 of them, and <code>go env GOOS GOARCH<\/code> shows your own machine.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Go Cross Compilation and cgo<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>$ CGO_ENABLED=0 go build -o hello-static .\n$ file hello-static\nhello-static: ELF 64-bit LSB executable, x86-64, statically linked<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For pure Go code, Go cross compilation works with no extra effort. However, a package that uses cgo, Go&#8217;s bridge to C code, needs a C compiler for the target. So set <code>CGO_ENABLED=0<\/code> when you can. As a result, you get one static file with no outside dependencies, which suits tiny containers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Smaller Binaries and Version Numbers<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>$ go build -o hello .\n$ go build -ldflags=\"-s -w\" -o hello-small .\n$ ls -l hello hello-small\n2213620 hello\n1437880 hello-small<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">First, the <code>-s -w<\/code> linker flags drop debug information. In fact, that cut the file by about 35 percent in this test. Keep the full build for debugging, though, because stack traces need that data.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var version = \"dev\"\n\n$ go build -ldflags=\"-X main.version=1.2.0\" -o hello .\n$ .\/hello\nversion: 1.2.0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Similarly, the <code>-X<\/code> flag sets a string variable at build time. As a result, every release binary knows its own version without editing code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Code for One System Only<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ path_windows.go\nfunc configDir() string { return `C:\\ProgramData\\hello` }\n\n\/\/ path_other.go\n\/\/go:build !windows\n\nfunc configDir() string { return \"\/etc\/hello\" }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For example, a file ending in <code>_windows.go<\/code> only builds for Windows. Meanwhile, a <code>\/\/go:build<\/code> line at the top gives finer control. In addition, <code>runtime.GOOS<\/code> tells running code which system it is on.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Go Cross Compilation Mistakes<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Error you see<\/th><th>Why it happens<\/th><th>How to fix it<\/th><\/tr><\/thead><tbody><tr><td>go: unsupported GOOS\/GOARCH pair plan10\/amd64<\/td><td>Because the target name is misspelled.<\/td><td>So check <code>go tool dist list<\/code>.<\/td><\/tr><tr><td>exec format error<\/td><td>Because the binary was built for another system.<\/td><td>So match GOOS and GOARCH to the server.<\/td><\/tr><tr><td>cgo build fails for the target<\/td><td>Because a package needs a C compiler.<\/td><td>So set <code>CGO_ENABLED=0<\/code> or use a pure Go package.<\/td><\/tr><tr><td>macOS warns the app is from an unknown developer<\/td><td>Because the binary is not signed.<\/td><td>So sign it, or allow it in System Settings.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Build and release questions also appear in DevOps interviews. So practise with my <a href=\"https:\/\/smitabharat.com\/blog\/go-lang-interview-questions-and-answers\/\">Go interview questions and answers<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Official Resources<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">These pages come straight from the Go team, so they stay accurate and up to date.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/go.dev\/doc\/tutorial\/compile-install\">Go docs: Compile and install the application<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/pkg.go.dev\/cmd\/go#hdr-Build_constraints\">cmd\/go: Build constraints<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/go.dev\/doc\/install\/source#environment\">Go docs: Optional environment variables (GOOS and GOARCH)<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Quick Recap<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go cross compilation needs only the GOOS and GOARCH variables.<\/li>\n\n\n\n<li><code>go tool dist list<\/code> shows every supported target.<\/li>\n\n\n\n<li><code>CGO_ENABLED=0<\/code> gives simple, static binaries.<\/li>\n\n\n\n<li><code>-ldflags=\"-s -w\"<\/code> shrinks files, and <code>-X<\/code> stamps a version.<\/li>\n\n\n\n<li>File suffixes and <code>\/\/go:build<\/code> lines add system-specific code.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s Next?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can now ship one codebase to every major system. Next, we will package a Go web app into a small container image with Docker.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next lesson: <a href=\"https:\/\/smitabharat.com\/blog\/go-docker-deployment\/\">Go Docker Deployment: Build Tiny Container Images<\/a><\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Go cross compilation lets you build a program for Windows, macOS or Linux from one computer, with no extra tools. In this post, you&hellip;<\/p>\n","protected":false},"author":1,"featured_media":278,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_swapz_level":"","_swapz_series_part":0,"_swapz_hide_toc":false,"_swapz_hide_featured":false,"_swapz_description":"","footnotes":""},"categories":[15],"tags":[60,11,23,21],"swapz_series":[],"class_list":["post-294","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-go-lang","tag-go-build","tag-go-lang","tag-go-tutorial","tag-golang-basics"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Go Cross Compilation: Build for Windows, Mac, Linux<\/title>\n<meta name=\"description\" content=\"Learn Go cross compilation with simple examples: set GOOS and GOARCH, build for Windows, macOS and Linux, shrink files and add versions.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Go Cross Compilation: Build for Windows, Mac, Linux\" \/>\n<meta property=\"og:description\" content=\"Learn Go cross compilation with simple examples: set GOOS and GOARCH, build for Windows, macOS and Linux, shrink files and add versions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/\" \/>\n<meta property=\"og:site_name\" content=\"Smita Bharat - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-05-03T03:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-10T15:51:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-cross-compilation-build-featured.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Smita\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Smita\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-cross-compilation-build\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-cross-compilation-build\\\/\"},\"author\":{\"name\":\"Smita\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"headline\":\"Go Cross Compilation: Build for Any OS\",\"datePublished\":\"2026-05-03T03:30:00+00:00\",\"dateModified\":\"2026-10-10T15:51:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-cross-compilation-build\\\/\"},\"wordCount\":645,\"publisher\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"image\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-cross-compilation-build\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-cross-compilation-build-featured.png\",\"keywords\":[\"Go Build\",\"Go Lang\",\"Go Tutorial\",\"Golang Basics\"],\"articleSection\":[\"Go Lang\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-cross-compilation-build\\\/\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-cross-compilation-build\\\/\",\"name\":\"Go Cross Compilation: Build for Windows, Mac, Linux\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-cross-compilation-build\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-cross-compilation-build\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-cross-compilation-build-featured.png\",\"datePublished\":\"2026-05-03T03:30:00+00:00\",\"dateModified\":\"2026-10-10T15:51:02+00:00\",\"description\":\"Learn Go cross compilation with simple examples: set GOOS and GOARCH, build for Windows, macOS and Linux, shrink files and add versions.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-cross-compilation-build\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-cross-compilation-build\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-cross-compilation-build\\\/#primaryimage\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-cross-compilation-build-featured.png\",\"contentUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-cross-compilation-build-featured.png\",\"width\":2400,\"height\":1260,\"caption\":\"Go Cross Compilation featured image: cards for GOOS, GOARCH and smaller binaries\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-cross-compilation-build\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Go Cross Compilation: Build for Any OS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/\",\"name\":\"Smita Bharat Blog\",\"description\":\"Golang &amp; Backend Development Tutorials and Interview Questions\",\"publisher\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"alternateName\":\"Smita Bharat\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\",\"name\":\"Smita\",\"logo\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/smitabharat.com\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Go Cross Compilation: Build for Windows, Mac, Linux","description":"Learn Go cross compilation with simple examples: set GOOS and GOARCH, build for Windows, macOS and Linux, shrink files and add versions.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/","og_locale":"en_US","og_type":"article","og_title":"Go Cross Compilation: Build for Windows, Mac, Linux","og_description":"Learn Go cross compilation with simple examples: set GOOS and GOARCH, build for Windows, macOS and Linux, shrink files and add versions.","og_url":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/","og_site_name":"Smita Bharat - Blog","article_published_time":"2026-05-03T03:30:00+00:00","article_modified_time":"2026-10-10T15:51:02+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-cross-compilation-build-featured.png","type":"image\/png"}],"author":"Smita","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Smita","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/#article","isPartOf":{"@id":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/"},"author":{"name":"Smita","@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"headline":"Go Cross Compilation: Build for Any OS","datePublished":"2026-05-03T03:30:00+00:00","dateModified":"2026-10-10T15:51:02+00:00","mainEntityOfPage":{"@id":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/"},"wordCount":645,"publisher":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"image":{"@id":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/#primaryimage"},"thumbnailUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-cross-compilation-build-featured.png","keywords":["Go Build","Go Lang","Go Tutorial","Golang Basics"],"articleSection":["Go Lang"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/","url":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/","name":"Go Cross Compilation: Build for Windows, Mac, Linux","isPartOf":{"@id":"https:\/\/smitabharat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/#primaryimage"},"image":{"@id":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/#primaryimage"},"thumbnailUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-cross-compilation-build-featured.png","datePublished":"2026-05-03T03:30:00+00:00","dateModified":"2026-10-10T15:51:02+00:00","description":"Learn Go cross compilation with simple examples: set GOOS and GOARCH, build for Windows, macOS and Linux, shrink files and add versions.","breadcrumb":{"@id":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/#primaryimage","url":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-cross-compilation-build-featured.png","contentUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-cross-compilation-build-featured.png","width":2400,"height":1260,"caption":"Go Cross Compilation featured image: cards for GOOS, GOARCH and smaller binaries"},{"@type":"BreadcrumbList","@id":"https:\/\/smitabharat.com\/blog\/go-cross-compilation-build\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/smitabharat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Go Cross Compilation: Build for Any OS"}]},{"@type":"WebSite","@id":"https:\/\/smitabharat.com\/blog\/#website","url":"https:\/\/smitabharat.com\/blog\/","name":"Smita Bharat Blog","description":"Golang &amp; Backend Development Tutorials and Interview Questions","publisher":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"alternateName":"Smita Bharat","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/smitabharat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339","name":"Smita","logo":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/smitabharat.com\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts\/294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/comments?post=294"}],"version-history":[{"count":3,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts\/294\/revisions"}],"predecessor-version":[{"id":340,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts\/294\/revisions\/340"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/media\/278"}],"wp:attachment":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/media?parent=294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/categories?post=294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/tags?post=294"},{"taxonomy":"swapz_series","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/swapz_series?post=294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}