Skip to content

cmd/go/internal/modload: reject the -modfile flag in workspace mode #60033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ZekeLu
Copy link
Contributor

@ZekeLu ZekeLu commented May 7, 2023

Currently, in workspace mode, the -modfile flag affects all the modules
listed in the go.work file. This is not desirable most of the time. And
when it results in an error, the error message does not help.

For example, when there are more than one modules listed in the go.work
file, running "go list -m -modfile=path/to/go.mod" gives this error:
go: module example.com/foo appears multiple times in workspace

This change reject -modfile flag explicitly with this error message:
go: -modfile cannot be used in workspace mode

While at here, correct some typos in the modload package.

Fixes #59996.

@ZekeLu ZekeLu changed the title cmd/go/internal/modload: reject -modfile flag in workspace mode cmd/go/internal/modload: reject the -modfile flag in workspace mode May 7, 2023
@gopherbot
Copy link
Contributor

This PR (HEAD: 1e6c402) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/493315 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Bryan Mills:

Patch Set 1: Code-Review+2

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/493315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 64c8d4a) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/493315 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Zeke Lu:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/493315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Bryan Mills:

Patch Set 2: Auto-Submit+1 Code-Review+2 Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/493315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/493315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/493315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 2: TryBot-Result-1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/493315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Bryan Mills:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/493315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/493315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/493315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 2: TryBot-Result-1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/493315.
After addressing review feedback, remember to publish your drafts!

Currently, in workspace mode, the -modfile flag affects all the modules
listed in the go.work file. This is not desirable most of the time. And
when it results in an error, the error message does not help.

For example, when there are more than one modules listed in the go.work
file, running "go list -m -modfile=path/to/go.mod" gives this error:
  go: module example.com/foo appears multiple times in workspace

This change reject -modfile flag explicitly with this error message:
  go: -modfile cannot be used in workspace mode

While at here, correct some typos in the modload package.
@gopherbot
Copy link
Contributor

This PR (HEAD: 7dbc9c3) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/493315 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Zeke Lu:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/493315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Bryan Mills:

Patch Set 3: Auto-Submit+1 Code-Review+2 Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/493315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 3:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/493315.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 3: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/493315.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request May 12, 2023
Currently, in workspace mode, the -modfile flag affects all the modules
listed in the go.work file. This is not desirable most of the time. And
when it results in an error, the error message does not help.

For example, when there are more than one modules listed in the go.work
file, running "go list -m -modfile=path/to/go.mod" gives this error:
  go: module example.com/foo appears multiple times in workspace

This change reject -modfile flag explicitly with this error message:
  go: -modfile cannot be used in workspace mode

While at here, correct some typos in the modload package.

Fixes #59996.

Change-Id: Iff4cd9f3974ea359889dd713a747b6932cf42dfd
GitHub-Last-Rev: 7dbc9c3
GitHub-Pull-Request: #60033
Reviewed-on: https://go-review.googlesource.com/c/go/+/493315
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
Auto-Submit: Bryan Mills <[email protected]>
Run-TryBot: Bryan Mills <[email protected]>
@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/493315 has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cmd/go: reject the -modfile flag in workspace mode
2 participants