https://github.com/abdulsametileri/go-binary-version-manager
Version manager for binaries that installed via go install command
https://github.com/abdulsametileri/go-binary-version-manager
cli go golang version-manager
Last synced: over 1 year ago
JSON representation
Version manager for binaries that installed via go install command
- Host: GitHub
- URL: https://github.com/abdulsametileri/go-binary-version-manager
- Owner: Abdulsametileri
- License: apache-2.0
- Created: 2024-06-09T12:27:41.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-27T18:59:31.000Z (about 2 years ago)
- Last Synced: 2025-02-28T08:37:03.660Z (over 1 year ago)
- Topics: cli, go, golang, version-manager
- Language: Go
- Homepage:
- Size: 157 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-binary-version-manager (gbvm)
Version manager of libraries which installed via `go install` command.
[](https://github.com/Abdulsametileri/go-binary-version-manager/actions/workflows/test.yml)
[](https://goreportcard.com/report/github.com/Abdulsametileri/go-binary-version-manager)
# Motivation
The projects I worked on used different versions of the `golangci-lint` and `mockery` libraries. When I use their
commands, inconsistent, strange errors occur.
I am aiming to solve this problem by writing a basic binary manager that uses symlink under the hood.
This project is not specific to golangci-lint, mockery. You can use any library you want. The condition is the library
must be installed via `go install` command.
**Note**: Executable binaries must be within ($GOPATH/go/bin) before using gbvm.
For example, if you installed golangci-lint via homebrew, you need to delete it first.
You should install with `gbvm install` command. Please check demo.
# Demo
[](https://asciinema.org/a/665884)
# Installation
### via Brew
`brew install abdulsametileri/tap/gbvm`
# Behind the scenes

# Commands
| Command | Explanation | Example |
|-------------------------------|------------------------------------------------------|-------------------------------------------------------|
| gbvm listall $LIBRARY | it lists all installed versions of the given library | `gbvm listall mockery` |
| gbvm enable $LIBRARY@$VERSION | it enables given version of the library | `gbvm enable golangci-lint@v1.55.1` |
| gbvm install $package | it installs given version of the library | `gbvm install github.com/vektra/mockery/v2@v2.20.0` |
| gbvm uninstall $package | it uninstalls given version of the library | `gbvm uninstall github.com/vektra/mockery/v2@v2.20.0` |
# Having issue
## Enable logs
```
You can enable debug logs via -v=5
gbvm enable golangci-lint@v1.59.0 -v=5
PanicLevel (0), Fatal (1), Error (2)
Warn (3), Info (4), Debug (5), Trace (6)
```
## Check your zshrc/bashrc
```
This library heavily used `go env GOPATH`, please check
export PATH=$PATH:$(go env GOPATH)/bin
defined your zshrc/bashrc
```