【譯】Part 1: 介紹和安裝

原文地址: Part 1: Introduction and Installation
原文做者: Naveen R
譯者:jacsice 轉載請註明出處。更多進階譯文請查看咔嘰咔嘰

這是golang入門系列裏面的第一篇。node

什麼是 Golang

Go 就是Golang

is an open source, compiled and statically typed programming language created by google.python

The primary focus of Golang is to make the development of highly available and scalable web apps simple and easy.linux

是google創造的開源的,可編譯的,靜態類型的編程語言。golang

Golang的主要關注點在於使開發高可用的,可擴展的web apps簡單便捷。web

Why Golang

Why would you choose Golang as your service side programming language when there are tonnes of other languages such as python, ruby, nodejs... that do the same job.編程

Here are some of the pros which I found in choosing Goruby

  • Concurrency is an inherent part of the language. As a result writing multithreaded programs is a piece of cake. This is achieved by Goroutines and channels which we will discuss later in the upcoming tutorials.
  • 併發是該語音與生俱來的部分。使得寫多線程的程序小菜一碟。這些是經過goroutines和channels完成的。
  • Golang is a compiled language. The source code is compiled to native binary. This is missing in interpreted languages such as JavaScript used in nodejs.
  • Golang是一種編譯語言。源代碼被編譯爲二進制文件。在諸如nodejs中使用的JavaScript之類的解釋語言中缺乏此功能。
  • The language spec is pretty simple. The entire spec fits in a page and you can even use it to write your own compiler :)
  • 語言的規範很是簡單。所有的規範都在這一個頁面裏面,你甚至能夠用它來當作你的編譯器。
  • The go compiler supports static linking. All the go code can be statically linked into one big fat binary and it can be deployed in cloud servers easily without worrying about dependencies.
  • go編譯器支持靜態連接。全部go代碼均可以靜態連接到一個大的二進制文件中,而且能夠輕鬆地部署在雲服務器中,而沒必要擔憂依賴性。

Installation

Golang is supported on all the three platforms Mac, Windows and Linux. You can download the binary for the corresponding platform from golang.org/dl/服務器

Mac OS

Download the OS X installer from golang.org/dl/. Double tap to start the installation. Follow the prompts and this should have Golang installed in 多線程

/usr/local/go

and would have also added the folder 併發

/usr/local/go/bin

to your PATH environment variable.

Windows

Download the MSI installer from golang.org/dl/. Double tap to start the installation and follow the prompts. This will install Golang in location

c:\Go

and will also add the directory

c:\Go\bin

to your path environment variable.

Linux

Download the tar file from golang.org/dl/ and unzip it to /usr/local.

Add /usr/local/go/bin to the PATH environment variable. This should install go in linux.

相關文章
相關標籤/搜索