You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
directory . outside modules listed in go.work or their selected dependencies
It's not clear what's going on with this error due to the period alongside the lack of slashes indicating a file location. For this very specific situation, "directory ." could be replaced with "current directory" and save Google millions of engineer hours.
proposal: replace directory . outside modules listed in go.work or their selected dependencies with current directory is outside modules listed in go.work or their selected dependencies or directory ./ outside modules listed in go.work or their selected dependencies
proposal2: add go work toggle feature
proposal3: add way to exclude folder from go workspace
The text was updated successfully, but these errors were encountered:
This occurred when I attempted to use go build from ./_gen/ in this repository with the ./ in go.work removed. This happened because something (VSCODE?) set the GOWORK variable to the opened folder (./disgo), which toggles workspace mode (https://go.dev/ref/mod#workspaces). The fix was to set workspace mode off by setting the environment variable: GOWORK=off.
Either I'm using workspaces incorrectly, or this is a good opportunity to suggest a toggle feature for the go work tool. Hopefully someone can show me that I'm wrong on the internet and how to fix that issue. Specifically, how to exclude directories from the workspace (cause I need to include ./ in go.work) and how to not have to use the GOWORK environment variable to build in that folder?
changed the title
proposal: workspace: add better language for go workspace error
proposal: workspace: add toggle command
Nov 11, 2022
Here is my eventual end goal (use case) for that repository.
disgo.go (developers import this)
- `disgo` go module
- bundled code (fieldaligned)
- used in ./tools, ./cache, ./shard, ./_examples
- filepath is ./
wrapper (for development purposes only)
- `wrapper` go module
- human readable code
- not used anywhere
- filepath is ./wrapper
generator (used during development)
- not used as a go module (`go build`)
- generator code execution
- not used anywhere
- filepath is ./_gen
Currently, I can't do this because I must use ./ in the go workspace, but cannot exclude _,/gen or ./wrapper from the go.work file.