design/ clearly discourage files in repos

The benefits are not worth the costs. Remove refrences to
files in repos and clearly discourage them.

Also make it clear that this proposal does not advocate adding build
configuration info to
Change-Id: I41e52c4215b55062924b9beca2463d4ed8b919cc
Trust: Michael Matloob <>
Run-TryBot: Michael Matloob <>
Reviewed-by: Michael Matloob <>
diff --git a/design/ b/design/
index 23e3ade..f64819c 100644
--- a/design/
+++ b/design/
@@ -378,19 +378,14 @@
 requirements on released modules which is out of scope for this proposal.
 Our goal is that when there are several tightly coupled modules in the same
-repository, users would choose to check `` files defining the workspace
-into the repository instead of `replaces` in the `go.mod` files. A monorepo with
-multiple modules might choose to have a `` file in the root, and users
-can change the workspace with the `-workfile` flag to confirm the build
-configurations when the modules are depended on from outside. Because the `go`
-command will operate in workspace mode when run within the repository, CI/CD
-systems should be configured to test with `-workfile=off`. If not, the CI/CD
-systems will not test that version requirements among the repository's modules
-are properly incremented to use changes in the modules.
-As a counterpoint to the above, most files should exist outside of any
-repository: `` files should only be used in repositories if they contain
-multiple tightly-coupled modules. If a repository contains a single module, or
+repository, users would choose to create `` files defining the workspace
+using the modules in those repositories instead of adding `replaces` in the
+`go.mod` files. These `` files should not be checked into the
+repositories so that they don't override the workspaces users explicitly define.
+Checking in `` files could also lead to CI/CD systems not testing the
+actual set of version requirements on a module and that version requirements
+among the repository's modules are properly incremented to use changes in the
+modules. And of course, if a repository contains only a single module, or
 unrelated modules, there's not much utility to adding a `` file because
 each user may have a different directory structure on their computer outside of
 that repository.
@@ -417,16 +412,15 @@
 replace  => ../
-This `replace` can be removed and replaced with a `` file in the top
-level of the `` repo that includes both modules:
+This `replace` can be removed and replaced with a `` file that includes
+both modules in the directory above the checkout of the ``
 go 1.17
 directory (
-    .
-    ./gopls
+    ./tools
+    ./tools/gopls
@@ -552,6 +546,11 @@
 different meaning. On the other hand, names like `modvers` and `moddir` are
+`` files should not be checked into version control repos containing
+modules so that the `` file in a module does not end up overriding
+the configuration a user created themselves outside of the module. The ``
+documentation should contain clear warnings about this.
 ### Semantics of workspace mode
 A single build list is constructed from the set of workspace modules to give
@@ -705,12 +704,21 @@
 ### [#39005]( proposal: cmd/go: introduce a build configurations file
-This issue proposes to add a mechanism to specify configurations for builds,
-such as build tags. This might be something that can be added in a future
-extension of `` files.
+Issue [#39005]( proposes to add a
+mechanism to specify configurations for builds, such as build tags. This issue
+is similar in that it is a proposal for additional configuration outside the
+`go.mod` file. This proposal does not advocate for adding this type of
+information to `` and is focused on making changes across multiple
 ## Open issues
+### The name of the `directory` directive
+The name `directory` could lead people to believe that all modules under the
+directory are included rather than just one. It might be better to use another
+name. One alternative that has been suggested is `include`.
 ### Clearing `replace`s
 We might want to add a mechanism to ignore all replaces of a module or module
@@ -726,17 +734,15 @@
 might not want to remove the existing replacements for policy reasons (or
 because the replacement is actually in a separate repo).
-### A rough edge with checked-in `` files
+### Preventing `` files from being checked in to repositories
-If a repository already has a checked in `` file in the module root,
-this can create an inconvenience for developers who want to set up a different
-workspace. The `` file will override any `` file that exists
-outside the repo, and they will need to either work with their current directory
-outside the repo or pass `-workfile` to the `go` command. In either case it's an
-inconvenience. The hope is that `` files are rarely checked into repos:
-checked in `` files are only useful in multi-module repositories
-(otherwise they'd point to directories outside the repo or only contain
-replaces) and most repositories contain only a single module.
+`` files that checked into repositories would cause confusion for Go
+users because they change the build configuration without the user explicitly
+opting in. Because of this they should be strongly discouraged. Though it's
+not clear that the Go tool should enforce this, other tools that vet
+repositories and releases should output warnings or errors for repositories
+containing `` files. There may also be other mechanisms not yet
+considered in this document to discourage checked-in `` files.
 ### Setting the `GOWORK` environment variable instead of `-workfile`