Categorygithub.com/moisespsena-go/goenv
repositorypackage
1.1.4
Repository: https://github.com/moisespsena-go/goenv.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

GoEnv

The virtual enviroments manager for Go!.

Installation

Get Binaries

See to RELEASES PAGE and get your binary file for various operational systems and architecturies.

NOTE: If gets alone binary, extract it (if archived) and PUT the directory into your PATH enviroment variable.

Check your $PATH enviroment variable:

export PATH=/dir/of/my/goenv_binary:$PATH

Build

Get sources:

go get -u github.com/moisespsena-go/goenv/goenv

Check your $PATH enviroment variable:

export PATH=$GOPATH/bin:$PATH

Add shortcut commands and Auto Completion

goenv setup | tee -a ~/.bashrc
source ~/.bashrc

Usage

The help command

goenv -h

Output:

The virtual enviroments manager for Go!

Usage:
  goenv [command]

Available Commands:
  activate    Activate the virtualenv with NAME.
  backup      Create backup .tar.gz file for the virtualenv with have NAME.
  completion  Generates bash completion scripts
  db          Returns the current database path.
  help        Help about any command
  init        Init new virtual enviroment.
  ls          List all virtual enviroments on current database.
  path        Print env path
  restore     Restore backup.tar.gz file to the virtualenv with have NAME.
  rm          Remove the virtualenv with have NAME.
  setup       Generate sources for custom prompt commands.
  update      Update activation scripts.
  version     Show program version
  versions    Manage golang binary versions

Flags:
  -d, --db string   Database directory (default is $HOME/.goenv). (default "~/.goenv")
  -h, --help        help for goenv

Use "goenv [command] --help" for more information about a command.

Init new enviroment

goenv init env1

List enviroments

goenv ls

Activate repository:

eval $(goenv activate env1)

or (see to Database section)

source $(goenv db)/env1/activate

Deactivate it

goenv-deactivate

Remove repository:

Move to trash directory (DB_DIR/.trash, see to Database section):

goenv rm env1

Remove permanently:

goenv rm -p env1

Database

Get database path:

goenv db

Custom database path

With command paramenter

For use custom database path, set the -d flag:

goenv -d ~/custom-db args...

Examples:

goenv -d ~/custom-db init env2
goenv -d ~/custom-db ls
With enviroment variable

Set the enviroment variable:

export GOENVDB=~/custom-db

or

GOENVDB=~/custom-db goenv args...

Thank's!

By Moises P. Sena.