우분투 go 설치 (apt) 편집하기

경고: 로그인하지 않았습니다. 편집을 하면 IP 주소가 공개되게 됩니다. 로그인하거나 계정을 생성하면 편집자가 사용자 이름으로 기록되고, 다른 장점도 있습니다.

편집을 취소할 수 있습니다. 이 편집을 되돌리려면 아래의 바뀐 내용을 확인한 후 게시해주세요.

최신판 당신의 편집
4번째 줄: 4번째 줄:


==확인==
==확인==
<syntaxhighlight lang='console'>
<source 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
</syntaxhighlight>
</source>


==설치==
==설치==
<syntaxhighlight lang='console'>
<source lang='console'>
root@zetawiki:~# apt-get install golang-go
root@zetawiki:~# apt-get install golang-go
Reading package lists... Done
Reading package lists... Done
24번째 줄: 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]?  
</syntaxhighlight>
</source>
<syntaxhighlight lang='console'>
<source lang='console'>
... (생략)
... (생략)
This choice can be modified by running "dpkg-reconfigure golang-go".  
This choice can be modified by running "dpkg-reconfigure golang-go".  
32번째 줄: 32번째 줄:


<Yes>                                            <No>
<Yes>                                            <No>
</syntaxhighlight>
</source>
:{{Enter}}<ref>기본값인 Yes 선택</ref>
:{{Enter}}<ref>기본값인 Yes 선택</ref>
<syntaxhighlight lang='console'>
<source lang='console'>
... (생략)
... (생략)
Selecting previously unselected package golang-go.
Selecting previously unselected package golang-go.
40번째 줄: 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) ...
</syntaxhighlight>
</source>


==확인 2==
==확인 2==
<syntaxhighlight lang='console'>
<source lang='console'>
root@zetawiki:~# go version
root@zetawiki:~# go version
go version go1.6.2 linux/amd64
go version go1.6.2 linux/amd64
</syntaxhighlight>
</source>
<syntaxhighlight lang='console'>
<source 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
</syntaxhighlight>
</source>
<syntaxhighlight lang='console'>
<source lang='console'>
root@zetawiki:~# go env
root@zetawiki:~# go env
GOARCH="amd64"
GOARCH="amd64"
68번째 줄: 68번째 줄:
CXX="g++"
CXX="g++"
CGO_ENABLED="1"
CGO_ENABLED="1"
</syntaxhighlight>
</source>


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


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


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

제타위키에서의 모든 기여는 크리에이티브 커먼즈 저작자표시-동일조건변경허락 3.0 라이선스로 배포된다는 점을 유의해 주세요(자세한 내용에 대해서는 제타위키:저작권 문서를 읽어주세요). 만약 여기에 동의하지 않는다면 문서를 저장하지 말아 주세요.
또한, 직접 작성했거나 퍼블릭 도메인과 같은 자유 문서에서 가져왔다는 것을 보증해야 합니다. 저작권이 있는 내용을 허가 없이 저장하지 마세요!

취소 편집 도움말 (새 창에서 열림)