Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Go compiler be installed on Windows?

Tags:

windows

go

I've been looking on golang.org for a Windows compiler, but I can't seem to find it. I can only see Linux and OS X compilers. Does anyone know if Go programming can be done on Windows, or is it something that Google hasn't implemented yet?

Update: appears that as of now (Nov. 2012) golang.org has official binary releases for windows 32/x86_64.

like image 617
user208987 Avatar asked Nov 11 '09 19:11

user208987


People also ask

Can you run golang on windows?

Download go for Windows First, go to golang.org and click on “Download Go“. It will lead to the download page. There you will have to select the msi installer for windows.

Does Go have a compiler?

Go is a compiled language. This means we must run our source code files through a compiler, which reads source code and generates a binary, or executable, file that is used to run the program. Examples of other popular compiled languages include C, C++, and Swift.

Do I need the make tool to compile in go?

Often the release page would have windows executable but no instructions on how to compile on Windows, only on mac/linux with make There are no more Makefiles needed in Go, so the make tool isn't necessary. You also do not need cygwin.

How to install Golang on Windows?

Let’s start installing GoLang on Windows. 1. Download go for Windows. First, go to golang.org and click on “ Download Go “. It will lead to the download page. There you will have to select the msi installer for windows. Go download for Windows amd64. 2. Install go from .msi file.

How do I install go on Windows?

Go install. Select the tab for your computer's operating system below, then follow its installation instructions. Open the MSI file you downloaded and follow the prompts to install Go. By default, the installer will install Go to Program Files or Program Files (x86). You can change the location as needed.

Is there a non-destructive Go compiler for Windows?

gofmt.com/compile.htmlif you want to try some non-destructive Go programming on Windows. It can compile, link, and run your programs and show you the output. Please send me a private message if you find any vulnerability on that site. Thanks! – Randy Sugianto 'Yuku' Nov 18 '09 at 18:36 Update: erGo compiler was released for beta testing this week.


2 Answers

There are now installers for Windows, see Go under Windows

HelloWorld.go

package main  func main() {     println("Hello World!"); } 

Compile with 8g, link with 8l and then execute. Example:

8g HelloWorld.go 8l -o HelloWorld.exe HelloWorld.8 HelloWorld 
like image 79
Jonas Avatar answered Nov 16 '22 01:11

Jonas


It hasn't made it onto the Go Lang FAQ yet, but from the changelog:

Why doesn't Go run on Windows? We understand that a significant fraction of computers in the world run Windows and it would be great if those computers could run Go programs. However, the Go team is small and we don't have the resources to do a Windows port at the moment. We would be more than willing to answer questions and offer advice to anyone willing to develop a Windows version.

like image 34
mbarnett Avatar answered Nov 15 '22 23:11

mbarnett