Go workspaces enable managing multi-module repositories. Use this tag for questions about workspaces. Use also the [go] tag, and [go-modules] as needed.
Questions tagged [go-work]
7 questions
9
votes
1 answer
What does the go.work.sum file track in Go 1.18?
I just tried out the Go 1.18 workspace on an existing project. Consider the following project directory structure:
project-root/
|-- app/
| |-- go.mod
| |-- go.sum
Per documentation, I ran the command go work init ./app within the root directory…

Sam Herrmann
- 6,293
- 4
- 31
- 50
4
votes
1 answer
Is it possible to turn off a go workspace without deleting the go.work file?
I must be missing something here. It seems like the point of go workspaces is to enable local dev without mucking up the go.mod file with "replace", which seems great. But if a go.work file exists, any go command will silently use the local dev…

EMC
- 1,560
- 2
- 17
- 31
3
votes
1 answer
run go test command on multiple testfiles with go.work file
As of go 1.18 it is possible to use "go.work" files as multimodule workspace save file, equivalent to a "go.mod" file.
I want to know how to use the defined "go.work" file in the command go test.
I tried multiple approaches. When I print the go.work…

DataPhaseDan
- 33
- 4
2
votes
0 answers
Go workspace dependencies
I'm trying to get to grips with working with workspaces in go 1.18, and how to make it work well in a monorepo.
As a minimum example, I have the following project structure:
.
├── docker-compose.yml
├── go.work
├── makefile
└── project
├──…

テッド
- 776
- 9
- 21
2
votes
2 answers
How do I import a project within a Go Workspace?
I have a monorepo with multiple modules within it. Some of the modules are libraries, others are entry points that will produce binaries.
Here's my workspace project:
https://github.com/alshdavid/go-workspace-example
I have my "bar" library here…

David Alsh
- 6,747
- 6
- 34
- 60
0
votes
0 answers
Go language server VSCode and workspaces
I am trying to open my project in VSCode but I get the following error
could not import github.com/gorilla/mux (current file is not included in a workspace module)compilerBrokenImport
The above error goes for every third party and internal packages…

Apostolos
- 7,763
- 17
- 80
- 150
0
votes
1 answer
GO no go.mod file exists in directory
I'm starting with GO, and I want to create a virtualenv like in Python (to store import modules at the project directory itself), I read in GO's doc https://go.dev/doc/tutorial/workspaces and understand that GO's Create the workspace is what i'm…

Hadilen
- 21
- 3