본문 바로가기
프로그래밍/Go

Go : 개발 환경 구축 (Ubuntu 18.04)

by drogrammer 2021. 8. 30.
반응형

고랭 사용을 위해 개발환경을 구축해보자.

1. 다운로드 및 설치

아래 웹페이지에 방문해서 "Download Go form Linux" 버튼을 눌러 다운로드 받는다.

 

Download and install - The Go Programming Language

Download and install Download and install Go quickly with the steps described here. For other content on installing, you might be interested in: 1. Go download. Click the button below to download the Go installer. Download Go Don't see your operating syste

golang.org

 

가이드대로 다운로드 받은 파일을 /usr/local 에 풀어준다.

sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf ~/Downloads/go1.17.linux-amd64.tar.gz

 

2. 환경 설정

go 명령어를 터미널에서 바로 사용할 수 있도록, 홈 디렉토리의 .bashrc 를 수정하여 PATH를 추가하자.

vi ~/.bashrc
# ~/.bashrc 마지막 줄에..

export PATH=$PATH:/usr/local/go/bin

 

3. 테스트

터미널을 닫았다가 새로 열고, 아래 명령어를 실행하면,

go version

아래와 같이 나온다.

go version go1.17 linux/amd64
반응형

댓글