go-binary-version-manager

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

go-binary-version-manager (gbvm)

Version manager for go libraries, currently golangci-lint and mockery support. Other libraries can be added easily.

Go Report Card

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 infra is easy to extend for other libraries too :)

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 gobvm install command.

Demo

asciicast

Installation

via Brew

brew install abdulsametileri/tap/gbvm

via Golang

go install github.com/Abdulsametileri/go-binary-version-manager@latest

After installing go command, the binary artifact name is go-binary-version-manager, you can rename it like

mv $GOPATH/bin/go-binary-version-manager $GOPATH/bin/gbvm

or

mv $HOME/go/bin/go-binary-version-manager $HOME/go/bin/gbvm

Behind the scenes

behind-the-scenes.png

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 $LIBRARY@VERSION it installs given version of the library gbvm install mockery@v2.20.0
gbvm uninstall $LIBRARY@VERSION it uninstalls given version of the library gbvm uninstall mockery@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

TODO

  • e2e test like vx

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL