우분투 go 설치 (apt)

  다른 뜻에 대해서는 우분투 go 최신버전 설치 문서를 참조하십시오.
우분투 go 설치
apt-get install golang-go

1 확인[ | ]

root@zetawiki:~# go version
The program 'go' is currently not installed.  You can install it by typing:
apt-get install golang-go

2 설치[ | ]

root@zetawiki:~# apt-get install golang-go
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  golang-src
The following NEW packages will be installed:
  golang-go golang-src
0 upgraded, 2 newly installed, 0 to remove and 71 not upgraded.
Need to get 20.1 MB of archives.
After this operation, 81.5 MB of additional disk space will be used.
Do you want to continue [Y/n]?
... (생략)
This choice can be modified by running "dpkg-reconfigure golang-go". 

Report installation of public packages to Go Dashboard?  

<Yes>                                             <No>
Enter[1]
... (생략)
Selecting previously unselected package golang-go.
Unpacking golang-go (from .../golang-go_2%3a1-5_amd64.deb) ...
Setting up golang-src (2:1-5) ...
Setting up golang-go (2:1-5) ...

3 확인 2[ | ]

root@zetawiki:~# go version
go version go1.6.2 linux/amd64
root@zetawiki:~# apt show golang-go | grep Version
Version: 2:1.6-1ubuntu4
root@zetawiki:~# go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/usr/lib/go-1.6"
GOTOOLDIR="/usr/lib/go-1.6/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

4 테스트[ | ]

root@zetawiki:~# vi test.go
package main

import "fmt"

func main() {
    fmt.Println("Hello, World")
}
root@zetawiki:~# go run test.go
Hello, World

5 같이 보기[ | ]

6 주석[ | ]

  1. 기본값인 Yes 선택
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}