[GO] GO 설치 (Linux)

91Savage·2023년 1월 9일
0

Go

목록 보기
2/2

리눅스 Go 설치

https://golang.org/dl/ 접속하여 최신버전 확인

  • 설치
    GO_VERSION=1.19.4

curl -LO https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz

rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz

cat ~/.profile | grep /usr/local/go/bin || echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile

cat ~/.profile | grep GOPATH= || echo 'export GOPATH=$(go env GOPATH)' >> ~/.profile

cat ~/.profile | grep GOPATH/bin || echo 'export PATH=PATH:PATH:GOPATH/bin' >> ~/.profile

source ~/.profile

echo $GOPATH

go version

go version go1.19.4 linux/amd64

go: go.mod file not found in current directory or any parent directory. 에러 뜰 떄,

go env -w GO111MODULE=auto <- 치고 엔터

0개의 댓글