-
golang μ€μΉ νμΌ λ€μ΄λ‘λ
-
cd /usr/local/src
: ν΄λΉ ν΄λλ‘ μ΄λ -
sudo curl -O https://dl.google.com/go/go1.15.5.linux-amd64.tar.gz
: go 1.15.5 λ€μ΄λ‘λ -
go λ€μ΄λ‘λ μ¬μ΄νΈμμ μ΅μ λ²μ κ³Ό μ΄μ λ²μ λ€μ΄λ‘λ κ°λ₯
-
-
λ€μ΄λ‘λ νμΌ μμΆνκΈ°
-
sudo tar -C /usr/local -xzf go1.15.5.linux-amd64.tar.gz
-
cd /usr/local/go/bin
ν΄λλ‘ μ΄λ ν,./go version
μ λ ₯ν΄μ go version go1.15.5 linux/amd64κ° μΆλ ₯λλ©΄ μ±κ³΅
-
-
νκ²½λ³μ μ€μ
-
vi ~/.bash_profile
μ λ ₯ ν, μνλ pathλ₯Ό μ§μ (vi λͺ λ Ήμ΄λ₯Ό μ΄μ©ν΄μ μ λ ₯νκ³ μ μ₯)go μ€νμ μ΄λκ³³μμλ μμ λ‘κ² νκΈ° μν΄μ μ€μ νλ€.
-
export GOPATH=$HOME/go
-
export PATH=$PATH:$GOPATH/bin
-
export PATH=$PATH:/usr/local/go/bin
-
-
source ~/.bash_profile
μ λ ₯ν΄μ€μΌ λ°μλ¨ β¨
-
- go build λμ§μμ κ²½μ°
go : go.mod file not found in current directory on any parent directory; see 'go help modules'
- ν΄κ²° :
go env -w GO111MODULE=auto
λͺ λ Ήμ΄ μ λ ₯
- go νμΌ μ€νμ μν΄ κ΄λ ¨ package λ€μ΄λ‘λ μ, git λͺ
λ Ήμ΄ μΈμμλλ κ²½μ°
- git μ€μΉνλ©΄ package get κ°λ₯
- centos7 κΈ°μ€,
yum install git
λͺ λ Ήμ΄λ₯Ό ν΅ν΄ git μ€μΉ