From fbacf36eac89824d83f29dcdbf7b252e7b1fe034 Mon Sep 17 00:00:00 2001 From: Michael Matloob Date: Mon, 19 Apr 2021 15:55:58 -0400 Subject: design/draft-workspace.md: clarify replace example Change-Id: I515292cd1182c7a777255511ea4c7dd7559da8b3 Reviewed-on: https://go-review.googlesource.com/c/proposal/+/311609 Trust: Michael Matloob Run-TryBot: Michael Matloob Reviewed-by: Michael Matloob --- design/draft-workspace.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/design/draft-workspace.md b/design/draft-workspace.md index 14638ea..ebe2a10 100644 --- a/design/draft-workspace.md +++ b/design/draft-workspace.md @@ -193,7 +193,7 @@ Example: ``` replace ( - golang.org/x/tools => ./tools + golang.org/x/tools => ../tools golang.org/x/mod v0.4.1 => example.com/mymod v0.5 ) ``` @@ -491,8 +491,11 @@ modules already have many `replace`s in them that are necessary to properly build them. Not respecting them would break users unnessesarily. `replace` directives exist in the workspace file to allow for resolving conflicts between `replace`s in workspace modules. Because all workspace modules exist as -co-equals in the workspace, there is no other clear and intuitive way to resolve -`replace` conflicts. +co-equals in the workspace, there is no clear and intuitive way to resolve +`replace` conflicts without explicit input from the user. One alternative is +to add special syntax for overriding replaces to make the overriding behavior +more explicit, and an additional option is to add an option to add syntax to +nullify replaces without overriding them. Working in modules not listed in the workspace file is disallowed to avoid what could become a common source of confusion: if the `go` command stayed in -- cgit v1.3