"우분투 go 설치 (apt)"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(다른 사용자 한 명의 중간 판 3개는 보이지 않습니다)
1번째 줄: 1번째 줄:
{{다른뜻|우분투 go 최신버전 설치}}
;우분투 go 설치
;우분투 go 설치
;apt-get install golang-go
;apt-get install golang-go


==확인==
==확인==
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:~# go version
root@zetawiki:~# go version
The program 'go' is currently not installed.  You can install it by typing:
The program 'go' is currently not installed.  You can install it by typing:
apt-get install golang-go
apt-get install golang-go
</source>
</syntaxhighlight>


==설치==
==설치==
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:~# apt-get install golang-go
root@zetawiki:~# apt-get install golang-go
Reading package lists... Done
Reading package lists... Done
23번째 줄: 24번째 줄:
After this operation, 81.5 MB of additional disk space will be used.
After this operation, 81.5 MB of additional disk space will be used.
Do you want to continue [Y/n]?  
Do you want to continue [Y/n]?  
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
... (생략)
... (생략)
This choice can be modified by running "dpkg-reconfigure golang-go".  
This choice can be modified by running "dpkg-reconfigure golang-go".  
31번째 줄: 32번째 줄:


<Yes>                                            <No>
<Yes>                                            <No>
</source>
</syntaxhighlight>
:{{Enter}}<ref>기본값인 Yes 선택</ref>
:{{Enter}}<ref>기본값인 Yes 선택</ref>
<source lang='console'>
<syntaxhighlight lang='console'>
... (생략)
... (생략)
Selecting previously unselected package golang-go.
Selecting previously unselected package golang-go.
39번째 줄: 40번째 줄:
Setting up golang-src (2:1-5) ...
Setting up golang-src (2:1-5) ...
Setting up golang-go (2:1-5) ...
Setting up golang-go (2:1-5) ...
</source>
</syntaxhighlight>


==확인 2==
==확인 2==
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:~# go version
root@zetawiki:~# go version
go version go1.6.2 linux/amd64
go version go1.6.2 linux/amd64
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:~# apt show golang-go | grep Version
root@zetawiki:~# apt show golang-go | grep Version
Version: 2:1.6-1ubuntu4
Version: 2:1.6-1ubuntu4
</source>
</syntaxhighlight>
<syntaxhighlight lang='console'>
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"
</syntaxhighlight>


==테스트==
==테스트==
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:~# vi test.go
root@zetawiki:~# vi test.go
</source>
</syntaxhighlight>
<source lang='go'>
<syntaxhighlight lang='go'>
package main
package main


63번째 줄: 82번째 줄:
     fmt.Println("Hello, World")
     fmt.Println("Hello, World")
}
}
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
root@zetawiki:~# go run test.go
root@zetawiki:~# go run test.go
Hello, World
Hello, World
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2020년 11월 2일 (월) 02:48 기준 최신판

  다른 뜻에 대해서는 우분투 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 }}