【译】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.

相关文章
相关标签/搜索