Dynamic workspaces for Go
This repository contains a set of scripts which, when invoked, append the current directory or the
directory of the invoked script to the beginning of
GOPATH and end of
PATH environment variables.
##Powershell If you use powershell as your console, you'll need first to enable scripts. Open powershell as administrator and:
There are two options:
###1. Activation Script Copy the files
godie.ps1 to your Go workspace folder. Whenever you call
(from any location) it'll append the script's directory to the beginning of
GOPATH and add the
subdirectory to the system
godie.ps1 (from any location) will reset changes. The changes will
only apply for the current console session.
SomeFolder\ WorkspaceFolder\ | |---goinit.ps1 |---godie.ps1 |---bin\ |---src\
###2. Profile Function
install.ps1. It will add functions
godie to the powershell
$profile file. So
whenever you enter
goinit in a powershell session, the current working directory will become the Go
godie will reverse changes.
Note: You need to reload your powershell profile/console after running install for the functions to become available.
godie.bat to each Go workspace. Running
goinit will add the directory of the
script to the
PATH variables to . Running
godie will restore changes. Changes only apply
for the current console session.
Append the contents of
goinit.sh to your
~/.bashrc file and reload your profile:
$ cat goinit.sh >> ~/.bashrc $ source ~/.bashrc
godie should set and unset the relevant environment variables and make current
directory a Go workspace. Changes do not persist across sessions.