TBR playground: moving all Go code under v.io prefix and making the v23 tool
aware of all of our Go workspaces

The purpose of this CL is to be able to build / test all of our Go
code by running:

$ v23 go [build|test] v.io/...

MultiPart: 2/8
Change-Id: I63fd3cc0ec176f2f61676ad4f7f35d8ac074b9e8
diff --git a/go/src/playground/.gitignore b/go/src/v.io/x/playground/.gitignore
similarity index 100%
rename from go/src/playground/.gitignore
rename to go/src/v.io/x/playground/.gitignore
diff --git a/go/src/playground/Dockerfile b/go/src/v.io/x/playground/Dockerfile
similarity index 98%
rename from go/src/playground/Dockerfile
rename to go/src/v.io/x/playground/Dockerfile
index e083a31..c70158d 100644
--- a/go/src/playground/Dockerfile
+++ b/go/src/v.io/x/playground/Dockerfile
@@ -36,7 +36,6 @@
 
 # Install Vanadium libraries and playground binaries.
 RUN v23 go install -v v.io/...
-RUN v23 go install -v playground/...
 
 # Uncomment the following lines to install a version of the builder tool using
 # your local version of the code. This is useful when developing and testing
diff --git a/go/src/playground/Makefile b/go/src/v.io/x/playground/Makefile
similarity index 92%
rename from go/src/playground/Makefile
rename to go/src/v.io/x/playground/Makefile
index 6f4bfa0..fb27b6f 100644
--- a/go/src/playground/Makefile
+++ b/go/src/v.io/x/playground/Makefile
@@ -24,11 +24,11 @@
 
 .PHONY: builder
 builder: builder-deps
-	v23 go install playground/builder
+	v23 go install v.io/x/playground/builder
 
 .PHONY: compilerd
 compilerd:
-	v23 go install playground/compilerd
+	v23 go install v.io/x/playground/compilerd
 
 .PHONY: start
 start: config/db.json all
diff --git a/go/src/playground/README.md b/go/src/v.io/x/playground/README.md
similarity index 96%
rename from go/src/playground/README.md
rename to go/src/v.io/x/playground/README.md
index 5b3a58a..19cf776 100644
--- a/go/src/playground/README.md
+++ b/go/src/v.io/x/playground/README.md
@@ -23,8 +23,8 @@
 
 Build the playground Docker image (this will take a while...):
 
-    $ cp ~/.netrc $V23_ROOT/release/projects/playground/go/src/playground/netrc
-    $ docker build -t playground $V23_ROOT/release/projects/playground/go/src/playground/.
+    $ cp ~/.netrc $V23_ROOT/release/projects/playground/go/src/v.io/x/playground/netrc
+    $ docker build -t playground $V23_ROOT/release/projects/playground/go/src/v.io/x/playground/.
 
 Note: If you want to ensure an up-to-date version of Vanadium is installed in
 the Docker image, run the above command with the "--no-cache" flag.
@@ -50,7 +50,7 @@
 
 Install the playground binaries:
 
-    $ GOPATH=$V23_ROOT/release/projects/playground/go v23 go install playground/...
+    $ GOPATH=$V23_ROOT/release/projects/playground/go v23 go install v.io/x/playground/...
 
 Run the compiler binary:
 
@@ -112,7 +112,7 @@
 
 Run the tests:
 
-    $ GOPATH=$V23_ROOT/release/projects/playground/go v23 go test playground/compilerd/...
+    $ GOPATH=$V23_ROOT/release/projects/playground/go v23 go test v.io/x/playground/compilerd/...
 
 
 # Database migrations
diff --git a/go/src/playground/builder/credentials.go b/go/src/v.io/x/playground/builder/credentials.go
similarity index 100%
rename from go/src/playground/builder/credentials.go
rename to go/src/v.io/x/playground/builder/credentials.go
diff --git a/go/src/playground/builder/main.go b/go/src/v.io/x/playground/builder/main.go
similarity index 99%
rename from go/src/playground/builder/main.go
rename to go/src/v.io/x/playground/builder/main.go
index 9795048..7f9559c 100644
--- a/go/src/playground/builder/main.go
+++ b/go/src/v.io/x/playground/builder/main.go
@@ -36,10 +36,9 @@
 	"syscall"
 	"time"
 
+	"v.io/x/playground/lib"
+	"v.io/x/playground/lib/event"
 	"v.io/x/ref/envvar"
-
-	"playground/lib"
-	"playground/lib/event"
 )
 
 var (
diff --git a/go/src/playground/builder/services.go b/go/src/v.io/x/playground/builder/services.go
similarity index 99%
rename from go/src/playground/builder/services.go
rename to go/src/v.io/x/playground/builder/services.go
index cf0dafa..e332178 100644
--- a/go/src/playground/builder/services.go
+++ b/go/src/v.io/x/playground/builder/services.go
@@ -18,9 +18,8 @@
 	"strconv"
 	"time"
 
+	"v.io/x/playground/lib"
 	"v.io/x/ref/envvar"
-
-	"playground/lib"
 )
 
 var (
diff --git a/go/src/playground/compilerd/compile.go b/go/src/v.io/x/playground/compilerd/compile.go
similarity index 97%
rename from go/src/playground/compilerd/compile.go
rename to go/src/v.io/x/playground/compilerd/compile.go
index 206799d..2eeef40 100644
--- a/go/src/playground/compilerd/compile.go
+++ b/go/src/v.io/x/playground/compilerd/compile.go
@@ -19,10 +19,10 @@
 
 	"github.com/golang/groupcache/lru"
 
-	"playground/compilerd/jobqueue"
-	"playground/lib"
-	"playground/lib/event"
-	"playground/lib/hash"
+	"v.io/x/playground/compilerd/jobqueue"
+	"v.io/x/playground/lib"
+	"v.io/x/playground/lib/event"
+	"v.io/x/playground/lib/hash"
 )
 
 var (
diff --git a/go/src/playground/compilerd/compile_test.go b/go/src/v.io/x/playground/compilerd/compile_test.go
similarity index 97%
rename from go/src/playground/compilerd/compile_test.go
rename to go/src/v.io/x/playground/compilerd/compile_test.go
index 8cd1a43..add4a55 100644
--- a/go/src/playground/compilerd/compile_test.go
+++ b/go/src/v.io/x/playground/compilerd/compile_test.go
@@ -12,9 +12,9 @@
 	"testing"
 	"time"
 
-	"playground/compilerd/jobqueue"
-	"playground/lib/event"
-	"playground/lib/hash"
+	"v.io/x/playground/compilerd/jobqueue"
+	"v.io/x/playground/lib/event"
+	"v.io/x/playground/lib/hash"
 )
 
 // mockDispatcher implements the jobqueue.Dispatcher interface.
diff --git a/go/src/playground/compilerd/jobqueue/jobqueue.go b/go/src/v.io/x/playground/compilerd/jobqueue/jobqueue.go
similarity index 99%
rename from go/src/playground/compilerd/jobqueue/jobqueue.go
rename to go/src/v.io/x/playground/compilerd/jobqueue/jobqueue.go
index 553e27d..e9df960 100644
--- a/go/src/playground/compilerd/jobqueue/jobqueue.go
+++ b/go/src/v.io/x/playground/compilerd/jobqueue/jobqueue.go
@@ -39,8 +39,8 @@
 	"sync"
 	"time"
 
-	"playground/lib"
-	"playground/lib/event"
+	"v.io/x/playground/lib"
+	"v.io/x/playground/lib/event"
 )
 
 var (
diff --git a/go/src/playground/compilerd/jobqueue/jobqueue_test.go b/go/src/v.io/x/playground/compilerd/jobqueue/jobqueue_test.go
similarity index 99%
rename from go/src/playground/compilerd/jobqueue/jobqueue_test.go
rename to go/src/v.io/x/playground/compilerd/jobqueue/jobqueue_test.go
index 4619318..7c882f5 100644
--- a/go/src/playground/compilerd/jobqueue/jobqueue_test.go
+++ b/go/src/v.io/x/playground/compilerd/jobqueue/jobqueue_test.go
@@ -16,7 +16,7 @@
 	"testing"
 	"time"
 
-	"playground/lib/event"
+	"v.io/x/playground/lib/event"
 )
 
 var (
diff --git a/go/src/playground/compilerd/main.go b/go/src/v.io/x/playground/compilerd/main.go
similarity index 99%
rename from go/src/playground/compilerd/main.go
rename to go/src/v.io/x/playground/compilerd/main.go
index 118a0e1..5dd9b00 100644
--- a/go/src/playground/compilerd/main.go
+++ b/go/src/v.io/x/playground/compilerd/main.go
@@ -26,8 +26,7 @@
 	"time"
 
 	"v.io/x/lib/dbutil"
-
-	"playground/compilerd/storage"
+	"v.io/x/playground/compilerd/storage"
 )
 
 func init() {
diff --git a/go/src/playground/compilerd/storage.go b/go/src/v.io/x/playground/compilerd/storage.go
similarity index 98%
rename from go/src/playground/compilerd/storage.go
rename to go/src/v.io/x/playground/compilerd/storage.go
index 30e4797..5529625 100644
--- a/go/src/playground/compilerd/storage.go
+++ b/go/src/v.io/x/playground/compilerd/storage.go
@@ -18,7 +18,7 @@
 	"log"
 	"net/http"
 
-	"playground/compilerd/storage"
+	"v.io/x/playground/compilerd/storage"
 )
 
 //////////////////////////////////////////
diff --git a/go/src/playground/compilerd/storage/db.go b/go/src/v.io/x/playground/compilerd/storage/db.go
similarity index 100%
rename from go/src/playground/compilerd/storage/db.go
rename to go/src/v.io/x/playground/compilerd/storage/db.go
diff --git a/go/src/playground/compilerd/storage/migration_test.go b/go/src/v.io/x/playground/compilerd/storage/migration_test.go
similarity index 99%
rename from go/src/playground/compilerd/storage/migration_test.go
rename to go/src/v.io/x/playground/compilerd/storage/migration_test.go
index 2c3f523..3c0d7cd 100644
--- a/go/src/playground/compilerd/storage/migration_test.go
+++ b/go/src/v.io/x/playground/compilerd/storage/migration_test.go
@@ -13,10 +13,10 @@
 	"fmt"
 	"testing"
 
-	"v.io/x/lib/dbutil"
-
 	_ "github.com/go-sql-driver/mysql"
 	"github.com/rubenv/sql-migrate"
+
+	"v.io/x/lib/dbutil"
 )
 
 var (
diff --git a/go/src/playground/compilerd/storage/model.go b/go/src/v.io/x/playground/compilerd/storage/model.go
similarity index 99%
rename from go/src/playground/compilerd/storage/model.go
rename to go/src/v.io/x/playground/compilerd/storage/model.go
index ecd5167..6066e28 100644
--- a/go/src/playground/compilerd/storage/model.go
+++ b/go/src/v.io/x/playground/compilerd/storage/model.go
@@ -38,7 +38,7 @@
 	_ "github.com/go-sql-driver/mysql"
 	"github.com/jmoiron/sqlx"
 
-	"playground/lib/hash"
+	"v.io/x/playground/lib/hash"
 )
 
 var (
diff --git a/go/src/playground/compilerd/storage/model_test.go b/go/src/v.io/x/playground/compilerd/storage/model_test.go
similarity index 98%
rename from go/src/playground/compilerd/storage/model_test.go
rename to go/src/v.io/x/playground/compilerd/storage/model_test.go
index 12b580d..a35196c 100644
--- a/go/src/playground/compilerd/storage/model_test.go
+++ b/go/src/v.io/x/playground/compilerd/storage/model_test.go
@@ -18,8 +18,7 @@
 	"github.com/rubenv/sql-migrate"
 
 	"v.io/x/lib/dbutil"
-
-	"playground/compilerd/storage"
+	"v.io/x/playground/compilerd/storage"
 )
 
 var (
diff --git a/go/src/playground/config/db-cloud-example.json b/go/src/v.io/x/playground/config/db-cloud-example.json
similarity index 100%
rename from go/src/playground/config/db-cloud-example.json
rename to go/src/v.io/x/playground/config/db-cloud-example.json
diff --git a/go/src/playground/config/db-local-example.json b/go/src/v.io/x/playground/config/db-local-example.json
similarity index 100%
rename from go/src/playground/config/db-local-example.json
rename to go/src/v.io/x/playground/config/db-local-example.json
diff --git a/go/src/playground/config/migrate.yml b/go/src/v.io/x/playground/config/migrate.yml
similarity index 100%
rename from go/src/playground/config/migrate.yml
rename to go/src/v.io/x/playground/config/migrate.yml
diff --git a/go/src/playground/deploy/monitor.py b/go/src/v.io/x/playground/deploy/monitor.py
similarity index 100%
rename from go/src/playground/deploy/monitor.py
rename to go/src/v.io/x/playground/deploy/monitor.py
diff --git a/go/src/playground/dummy.go b/go/src/v.io/x/playground/dummy.go
similarity index 100%
rename from go/src/playground/dummy.go
rename to go/src/v.io/x/playground/dummy.go
diff --git a/go/src/playground/lib/event/event.go b/go/src/v.io/x/playground/lib/event/event.go
similarity index 100%
rename from go/src/playground/lib/event/event.go
rename to go/src/v.io/x/playground/lib/event/event.go
diff --git a/go/src/playground/lib/event/json_sink.go b/go/src/v.io/x/playground/lib/event/json_sink.go
similarity index 100%
rename from go/src/playground/lib/event/json_sink.go
rename to go/src/v.io/x/playground/lib/event/json_sink.go
diff --git a/go/src/playground/lib/event/response_event_sink.go b/go/src/v.io/x/playground/lib/event/response_event_sink.go
similarity index 98%
rename from go/src/playground/lib/event/response_event_sink.go
rename to go/src/v.io/x/playground/lib/event/response_event_sink.go
index 6e69972..bfc7043 100644
--- a/go/src/playground/lib/event/response_event_sink.go
+++ b/go/src/v.io/x/playground/lib/event/response_event_sink.go
@@ -11,7 +11,7 @@
 	"io"
 	"sync"
 
-	"playground/lib"
+	"v.io/x/playground/lib"
 )
 
 // Initialize using NewResponseEventSink.
diff --git a/go/src/playground/lib/event/stream_writer.go b/go/src/v.io/x/playground/lib/event/stream_writer.go
similarity index 100%
rename from go/src/playground/lib/event/stream_writer.go
rename to go/src/v.io/x/playground/lib/event/stream_writer.go
diff --git a/go/src/playground/lib/hash/hash.go b/go/src/v.io/x/playground/lib/hash/hash.go
similarity index 100%
rename from go/src/playground/lib/hash/hash.go
rename to go/src/v.io/x/playground/lib/hash/hash.go
diff --git a/go/src/playground/lib/limited_writer.go b/go/src/v.io/x/playground/lib/limited_writer.go
similarity index 100%
rename from go/src/playground/lib/limited_writer.go
rename to go/src/v.io/x/playground/lib/limited_writer.go
diff --git a/go/src/playground/lib/multi_writer.go b/go/src/v.io/x/playground/lib/multi_writer.go
similarity index 100%
rename from go/src/playground/lib/multi_writer.go
rename to go/src/v.io/x/playground/lib/multi_writer.go
diff --git a/go/src/playground/migrations/001-create-tables.sql b/go/src/v.io/x/playground/migrations/001-create-tables.sql
similarity index 100%
rename from go/src/playground/migrations/001-create-tables.sql
rename to go/src/v.io/x/playground/migrations/001-create-tables.sql
diff --git a/go/src/playground/playground_v23_test.go b/go/src/v.io/x/playground/playground_v23_test.go
similarity index 97%
rename from go/src/playground/playground_v23_test.go
rename to go/src/v.io/x/playground/playground_v23_test.go
index c1fde73..3227b32 100644
--- a/go/src/playground/playground_v23_test.go
+++ b/go/src/v.io/x/playground/playground_v23_test.go
@@ -56,7 +56,7 @@
 
 	// TODO(ivanpi): move this out so it only gets invoked once even though
 	// the binary is cached.
-	builderBin := i.BuildGoPkg("playground/builder")
+	builderBin := i.BuildGoPkg("v.io/x/playground/builder")
 
 	PATH := "PATH=" + i.BinDir() + ":" + nodejsRoot
 	if path := os.Getenv("PATH"); len(path) > 0 {
@@ -87,7 +87,7 @@
 	i.BuildGoPkg("v.io/x/ref/services/proxy/proxyd")
 	i.BuildGoPkg("v.io/x/ref/services/wspr/wsprd")
 
-	playgroundPkg := golist(i, "playground")
+	playgroundPkg := golist(i, "v.io/x/playground")
 	// strip last three directory components, much easier to read in
 	// errors than <path>/../../..
 	playgroundRoot = filepath.Dir(playgroundPkg)
diff --git a/go/src/playground/sql_test_setup.sh b/go/src/v.io/x/playground/sql_test_setup.sh
similarity index 100%
rename from go/src/playground/sql_test_setup.sh
rename to go/src/v.io/x/playground/sql_test_setup.sh
diff --git a/go/src/playground/test.sh b/go/src/v.io/x/playground/test.sh
similarity index 96%
rename from go/src/playground/test.sh
rename to go/src/v.io/x/playground/test.sh
index 8937610..8d7e477 100755
--- a/go/src/playground/test.sh
+++ b/go/src/v.io/x/playground/test.sh
@@ -7,11 +7,11 @@
 
 # v.io/core/shell/lib/shell_test.sh sourced via playground/lib/pg_test_util.sh
 # (shell_test.sh has side effects, should not be sourced again)
-source "$(go list -f {{.Dir}} playground)/../../../client/lib/shell/pg_test_util.sh"
+source "${V23_ROOT}/release/projects/playground/client/lib/shell/pg_test_util.sh"
 
 # Sets up a glob file with the given files, then runs builder.
 test_with_files() {
-  local -r TESTDATA_DIR="$(go list -f {{.Dir}} playground)/testdata"
+  local -r TESTDATA_DIR="$(go list -f {{.Dir}} v.io/x/playground)/testdata"
 
   # Write input file paths to the glob file.
   local -r CONFIG_FILE="$(shell::tmp_dir)/test.bundle"
diff --git a/go/src/playground/testdata/src/ids/authorized.id b/go/src/v.io/x/playground/testdata/src/ids/authorized.id
similarity index 100%
rename from go/src/playground/testdata/src/ids/authorized.id
rename to go/src/v.io/x/playground/testdata/src/ids/authorized.id
diff --git a/go/src/playground/testdata/src/ids/expired.id b/go/src/v.io/x/playground/testdata/src/ids/expired.id
similarity index 100%
rename from go/src/playground/testdata/src/ids/expired.id
rename to go/src/v.io/x/playground/testdata/src/ids/expired.id
diff --git a/go/src/playground/testdata/src/ids/unauthorized.id b/go/src/v.io/x/playground/testdata/src/ids/unauthorized.id
similarity index 100%
rename from go/src/playground/testdata/src/ids/unauthorized.id
rename to go/src/v.io/x/playground/testdata/src/ids/unauthorized.id
diff --git a/go/src/playground/testdata/src/ping/ping.go b/go/src/v.io/x/playground/testdata/src/ping/ping.go
similarity index 100%
rename from go/src/playground/testdata/src/ping/ping.go
rename to go/src/v.io/x/playground/testdata/src/ping/ping.go
diff --git a/go/src/playground/testdata/src/ping/ping.js b/go/src/v.io/x/playground/testdata/src/ping/ping.js
similarity index 100%
rename from go/src/playground/testdata/src/ping/ping.js
rename to go/src/v.io/x/playground/testdata/src/ping/ping.js
diff --git a/go/src/playground/testdata/src/pingpong/wire.vdl b/go/src/v.io/x/playground/testdata/src/pingpong/wire.vdl
similarity index 100%
rename from go/src/playground/testdata/src/pingpong/wire.vdl
rename to go/src/v.io/x/playground/testdata/src/pingpong/wire.vdl
diff --git a/go/src/playground/testdata/src/pong/pong.go b/go/src/v.io/x/playground/testdata/src/pong/pong.go
similarity index 100%
rename from go/src/playground/testdata/src/pong/pong.go
rename to go/src/v.io/x/playground/testdata/src/pong/pong.go
diff --git a/go/src/playground/testdata/src/pong/pong.js b/go/src/v.io/x/playground/testdata/src/pong/pong.js
similarity index 100%
rename from go/src/playground/testdata/src/pong/pong.js
rename to go/src/v.io/x/playground/testdata/src/pong/pong.js
diff --git a/go/src/playground/v23_test.go b/go/src/v.io/x/playground/v23_test.go
similarity index 100%
rename from go/src/playground/v23_test.go
rename to go/src/v.io/x/playground/v23_test.go