<commit_before>#wgo: managed workspaces on top of the go tool#

##Overview##

The wgo tool is a small wrapper around the go tool. It adds the concept of a workspace, in addition to that of GOPATH, and several new commands to manage that workspace.

*Do not run 'wgo restore' anywhere you care about files - this tool is in alpha and might destroy everything.*

###Goals###

- Ease unnecessary confusion around how to handle the GOPATH environment variable, especially for new gophers.
- Provide a vendoring approach to dependency management for open source Go programs.
- Eventually be merged into the go tool itself (ha ha).

###How it works###

Workspaces and new subcommands.

####Workspaces####

A workspace is a directory that contains a directory ".gocfg" at its top level. Any wgo commands run with a working directory that is a subdirectory of the workspace (including the workspace itself) are said to be run from within that workspace.

####wgo foo####

When a wgo command is run from within a workspace, it runs the equivalent go command (by forwarding all arguments) with a modified environment: the GOPATH environment variable is prefixed with the workspace and any other gopaths listed in "W/.gocfg/gopaths".

So, if "W/.gocfg" exists, running wgo from within that workspace is the same as running go with `GOPATH=W:$GOPATH`. That is, the workspace will automatically be in the GOPATH, and have the highest precedence. Giving the highest GOPATH priority to "W" makes it so `go get` puts new packages in "W".
<commit_msg>Added fun use case to readme<commit_after>#wgo: managed workspaces on top of the go tool#

##Overview##

The wgo tool is a small wrapper around the go tool. It adds the concept of a workspace, in addition to that of GOPATH, and several new commands to manage that workspace.

*Do not run 'wgo restore' anywhere you care about files - this tool is in alpha and might destroy everything.*

###Goals###

- Ease unnecessary confusion around how to handle the GOPATH environment variable, especially for new gophers.
- Provide a vendoring approach to dependency management for open source Go programs.
- Eventually be merged into the go tool itself (ha ha).

###Typical use###

```
$ mkdir myproject
$ cd myproject
$ wgo init --set-primary third_party
$ wgo get github.com/someone/dep
$ mkdir src/myproj
$ emacs src/myproj/main.go
... import "github.com/someone/dep"
$ wgo install myproj
$ ./myproj
it works!
$ git init
$ wgo save > .gitignore
$ git add .gocfg .gitignore src/myproj
$ git remote add origin https://foo.git
$ git push origin
```
And later...
```
$ git clone https://foo.git
$ cd foo
$ wgo restore
github.com/someone/dep
$ ls -a
.gocfg src third_party
$ wgo install myproj
$ ./myproj
it works!
```

###How it works###

Workspaces and new subcommands.

####Workspaces####

A workspace is a directory that contains a directory ".gocfg" at its top level. Any wgo commands run with a working directory that is a subdirectory of the workspace (including the workspace itself) are said to be run from within that workspace.

####wgo foo####

When a wgo command is run from within a workspace, it runs the equivalent go command (by forwarding all arguments) with a modified environment: the GOPATH environment variable is prefixed with the workspace and any other gopaths listed in "W/.gocfg/gopaths".

So, if "W/.gocfg" exists, running wgo from within that workspace is the same as running go with `GOPATH=W:$GOPATH`. That is, the workspace will automatically be in the GOPATH, and have the highest precedence. Giving the highest GOPATH priority to "W" makes it so `go get` puts new packages in "W".

{'fraction_non_alphanumeric': 0.07586586036283673, 'fraction_numerical': 0.0, 'mean_word_length': 4.235971223021583, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '160718', 'n_tokens_mistral': 1016, 'n_tokens_neox': 973, 'n_words': 551}