Go (2) 썸네일형 리스트형 Ubuntu에 Cobra와 Cobra-cli 설치(cobra-cli: command not found 해결) Cobra란? https://github.com/spf13/cobra GitHub - spf13/cobra: A Commander for modern Go CLI interactions A Commander for modern Go CLI interactions. Contribute to spf13/cobra development by creating an account on GitHub. github.com CLI 애플리케이션을 만들기 위한 라이브러리로, Cobra를 사용하면 CLI 인터페이스를 간단하게 구현할 수 있다. Cobra를 사용한 예로 K8S의 kubectl, Docker CLI, Hugo, Helm 등이 있다. 1. Go 모듈 생성 # go mod init go mod init minha .. Ubuntu에 Go 설치(최신 버전 설치하는 방법) Go 공식페이지에서 OS에 맞는 파일 주소 복사 https://go.dev/dl/ All releases - The Go Programming Language go.dev wget 명령어로 파일 다운로드 wget https://go.dev/dl/go1.21.6.linux-amd64.tar.gz 압축 풀기 # sudo tar [OPTION...] [FILE] # /usr/local 디렉토리에 압축 풀기 sudo tar -C /usr/local -xzf go1.21.6.linux-amd64.tar.gz 환경 변수에 경로 추가 및 변경 사항 적용 cat ~/.profile | grep /usr/local/go/bin || echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/... 이전 1 다음