1 개요[ | ]
- GOPATH
- 고패쓰, 고경로
- Go 작업공간 경로
- 여러 개를 등록해도 되는데, 그럴 경우에는 현재 경로와 관련된 GOPATH가 기준이 된다.
예시 | |
---|---|
리눅스 | |
윈도우 |
|
- 실제 프로젝트 경로는 대략 다음과 같이 하자.
- $GOPATH/src/프로젝트 ★
- $GOPATH/src/github.com/사용자/프로젝트
2 예시[ | ]
로컬
Console
Copy
root@localhost:~# go env GOPATH
/root/go
Console
Copy
root@localhost:~# echo $GOPATH
/root/go
클라우드쉘
Console
Copy
testuser@cloudshell:~$ go env GOPATH
/home/testuser/gopath:/google/gopath
Console
Copy
testuser@cloudshell:~$ echo $GOPATH
/home/testuser/gopath:/google/gopath
Console
Copy
testuser@cloudshell:~$ echo $PATH | grep gopath
/opt/gradle/bin:/opt/maven/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/usr/local/nvm/versions/node/v12.14.1/bin:/usr/local/rvm/bin:/google/go_appengine:/google/google_appengine:/google/migrate/anthos/:/home/testuser/.gems/bin:/usr/local/rvm/bin:/home/testuser/gopath/bin:/google/gopath/bin:/google/flutter/bin
3 같이 보기[ | ]
4 참고[ | ]
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.