genv

command module
v0.0.0-...-dd010c6 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: BSD-2-Clause Imports: 10 Imported by: 0

README

genv is a Go imitation of Python's venv module

Why?

Go programmers typically put all their code into one workspace. Over time, it gets really difficult to keep track of dependencies and build artifacts (at least, this is the case for me). In Python development, we keep python versions and dependencies in one workspace per project. This helps isolate the dependencies for that project. Go has the additional headache of cleaning up old binaries. This project is meant to create a new workspace for each project.

How to use it

To create a development environment

$ go install github.com/nishakm/genv@latest
$ genv test
$ cd test
$ source bin/activate

To undo the dev environment

$ deactivate

To remove the dev environment

$ sudo rm -rf test

(note: root permissions are required as go sets all the file permissions to read only)

Controlling go versions

You can create dev environments for specific go versions. If the version doesn't exist in your dev environment, genv will download it for you.

$ genv -version go1.14.4 test
$ cd test
$ source bin/activate
(test)$ go version
go version go1.14.4 linux/amd64

Cloning a Go project

If you want to seed the dev environment with a specific Go project, you can do the following:

$ genv -project git@github.com/nishakm/genv test
$ cd test
$ source bin/activate
(test)$ cd gopath/src/github.com/nishakm/genv

Currently GitHub cloning via SSH and HTTPS are supported.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
envtool manages environments and github projects within a genv environment.
envtool manages environments and github projects within a genv environment.
cmd
This file with generated by cobra (github.com/spf13/cobra) which is licensed under the Apache License, Version 2.0 genv is distributed under the BSD-2-Clause license which is compatible with Apache-2.0 This file was generated by cobra (github.com/spf13/cobra) Licensed under the Apache License, Version 2.0 (the "License"); Command entry points are licensed under the BSD-2-Clause license
This file with generated by cobra (github.com/spf13/cobra) which is licensed under the Apache License, Version 2.0 genv is distributed under the BSD-2-Clause license which is compatible with Apache-2.0 This file was generated by cobra (github.com/spf13/cobra) Licensed under the Apache License, Version 2.0 (the "License"); Command entry points are licensed under the BSD-2-Clause license
pkg
project
Package project provides filepaths for corresponding remote VCSs Currently, github.com is the only one implemented
Package project provides filepaths for corresponding remote VCSs Currently, github.com is the only one implemented

Jump to

Keyboard shortcuts

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