Can Go compiler be installed on Windows?

前端 未结 9 2065
粉色の甜心
粉色の甜心 2020-12-23 14:16

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 don

相关标签:
9条回答
  • 2020-12-23 14:38

    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
    
    0 讨论(0)
  • 2020-12-23 14:39

    Although there is no Windows version at the moment, it can presumably be compiled using Cygwin on a Windows platform.

    0 讨论(0)
  • 2020-12-23 14:39

    Installation of Go on windows is straight forward if you use the experimental x32 windows port . Documentation of the steps for Go installation on windows can found here

    You will probably also want the MinGW tools (bash, make, gcc, etc...): http://sourceforge.net/projects/mingw/files/

    and the GTK+ files and tools (the "all-in-one bundle" includes pkg-config): http://www.gtk.org/download/win32.php

    0 讨论(0)
  • 2020-12-23 14:40

    Various efforts to port Go to windows are underway.

    The most advance and that can already build and run some code is here: http://code.google.com/r/hectorchu-go-windows/

    0 讨论(0)
  • 2020-12-23 14:42

    Yes! As of 2012 the Go homepage offers an official Windows installer (32 or 64 bit) https://golang.org/dl/

    0 讨论(0)
  • 2020-12-23 14:53

    So if you, like me, are on Windows a lot of the time and want to do some Go programming right now, you can do it on a VM. I use VirtualBox running Ubuntu in seemless mode. I already had it set up because I like Linux better than Windows for a lot of things.

    Building and working with Go has been totally painless for me. I have a Bash open in a terminal to run my build and try my app. The source directory is a shared folder between Windows and Linux (a VirtualBox feature but I'm sure VMWare has the same thing). I edit my code in Komodo Edit on Windows and use Mercurial for the same source code on both OSes.

    0 讨论(0)
提交回复
热议问题