Trying out the workspace proposal

73 views
Skip to first unread message

Michael Matloob

unread,
Jun 16, 2021, 4:56:15 PM6/16/21
to golang-tools
Hello!

I've got a stack of CLs that implements the core of the workspace proposal. There are still many bugs and unimplemented bits, but (with those caveats) it supports creating go.work files and building, running testing and listing from within workspaces. Change 328469 is a sentinel change that I'll keep at the top of the stack, so you can download its code at the latest patchset whenever you want and get the latest revision. To do so (assuming you've installed git-codereview), run:

git codereview change 328469

from your local copy of the Go git repository.

This will download and check out the commit at the top of the stack, including all the changes for the workspace proposal. Then you can build go using

$GOROOT/bin/go build -o $BINDIR/wgo cmd/go

assuming $GOROOT points to your checkout of go, $BINDIR points to a directory on your PATH, and wgo is a good name for this alternate version of the go command.

You can then run the wgo mod initwork command to create a new go.work file. Pass the paths to the module directories to be included in the workspace as arguments:

wgo mod initwork ./tools ./mod

will create the following go.work file in the working directory:

go 1.17

directory (
mod
tools
)

As a special experiment, we allow the '...' wildcard at the end of one of wgo mod initwork command to expand to all modules contained under the directory. For example,

wgo mod initwork gopath/...

will create a go.work file with all the modules contained in the gopath directory. Importantly, the ... pattern is expanded when initwork is run, so that the expanded set of modules is contained in the file, not the pattern.

Of course this is unreviewed, and many parts of it are untested, so all sorts of things can happen. I'll continue working on cleaning up, testing, and adding missing features so the design can be tested in its entirety. But in the meantime...

If you run into anything that's not working, but that you'd like to try out and give feedback please let me know so I can prioritize it. The best way to reach me is on slack @matloob, or you can email me.

Please try it out and give me feedback: I want both positive and negative feedback! And let me know if you've tried it even if you don't have any feedback at all, or if you want some help getting it to run.

Thanks!
Michael

Reply all
Reply to author
Forward
0 new messages