반응형

go install 명령어로 바이너리를 전역으로 설치할 수 있는데 딱히 이 바이너리를 일괄 업데이트하는 명령어가 없다.

각각의 바이너리를 go install <패키지>@latest로 일일이 업데이트하는 방법뿐...

찾아보니 gup라는 패키지가 있어서 소개한다.

https://github.com/nao1215/gup

 

GitHub - nao1215/gup: Fast manager for Go-installed binaries in $GOBIN: update, export/import, and migrate toolsets across machi

Fast manager for Go-installed binaries in $GOBIN: update, export/import, and migrate toolsets across machines - nao1215/gup

github.com

go install github.com/nao1215/gup@latest

위 명령어로 gup 패키지를 설치하고 아래 명령어로 전체 업데이트를 할 수 있다.

gup update

간단한 사용법은 이게 다이고 위 리포지토리에서 좀 더 자세한 사용법을 볼 수 있다.

번외로 go get 명령어로 설치한 패키지 업데이트 방법도 메모해 둔다. (install은 전역, get은 프로젝트 단위로 go.mod에 의존성 추가)

go get -u ./...
go mod tidy

go mod tidy는 불필요한 의존성을 정리하는 명령어다.

반응형

+ Recent posts