I've been playing with Go quite a bit lately, and found there to be quite a bit of boilerplate to get started with a new project. So I thew together gofish. It's a virtualenvwrapper inspired wrapper for working on Go projects in the Fish shell.
If you've used virtualenvwrapper (or virtualfish) the commands will be familiar to you.
To create a new go workspace:
$ mkgoworkspace project-name
This will created a project structure that looks like this:
/bin /pkg /src /zackkitzmiller /project-name main.go
The default namespace will be the currect user's username, but that can be overridded by setting the
GOFISH_NAMESPACE environment variable:
$ set -x GOFISH_NAMESPACE github.com/zackkitzmiller; and mkgoworkspace project-name
To switch the
$ goon project-name
To deactive a workspace completely:
The various commands all emit events, so you can listen for them in your fish config. The available events to listen to are:
The following example would send a growl notification on workspace activation
function announce --on-event gofish_workspace_activated command growlnotify -m "Workspace: " (basename $GO_CURRENT_WORKSPACE) " activated" -n 'gofish' end
The following global environment variables will be available after a successful workspace activation:
$GOPATH- as expected
This is still just a work in progress. Let me know what you think. And as always, pull requests welcome.
- multiple modules in same workspace
- auto git?