Support Go 1.18 workspaces
See original GitHub issueNX-GO : Support Go 1.18 workspaces
Go 1.18 introduces Go workspaces, a clean and nice way to manage a repository that contains multiple modules written in go. It works by adding a go.wok
file in the root directory and add a go.mod
file in each go module.
To adapt this solution to nx-go, we need to be able to manage versions before 1.18 (without the go.work
files) and the next versions.
It can be also nice to add an utility to upgrade the current workspaces to th new module management system.
App & libs creation
When creating apps and libs we have now 4 use cases. (The first match skip the followings)
- A
go.mod
file is in the root directory: the new package is created as before. - A
go.work
file is in the root directory: the package is created with its owngo.mod
file in its directory and it is added in theuse
list in thego.work
file. - The option “useWorkspace” is added in the command line the go version is checked, if it is before 1.18 an error is thrown otherwise, a
go.work
file is added in the root directory. - Same behavior as before 1.18
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Get familiar with workspaces - The Go Programming Language
Workspaces in Go 1.18 let you work on multiple modules simultaneously ... Workspaces are flexible and support a variety of workflows.
Read more >Support for go 1.18 "workspace" mode? · Issue #1232 - GitHub
Has anyone put any thought into gazelle support the new "workspace" mode added in go 1.18? Some reference links: Docs: https://go.dev/ref/mod# ...
Read more >Workspaces in Go 1.18 - zerokspot.com - Horst Gutmann
Let's say you have two packages: producer and consumer . You want to implement a great new feature in consumer but you need...
Read more >Go 1.18 Release Notes - The Go Programming Language
The go command now supports a "Workspace" mode. If a go.work file is found in the working directory or a parent directory, or...
Read more >Setting up your workspace
Starting with Go 1.18, the go command has native support for multi-module workspaces, via go.work files. These files are recognized by gopls starting...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The current stable version does not yet support it out of the box. As this issue is adding the functionality in question. There is a release candidates for 2.7.0 with support for workspaces though which you can evaluate.
@Anthony-Jhoiro may be better to answer how to use workspaces with 2.7.0 as I have been MIA for a few months and just getting caught up again.
Sounds good to me! Really sorry for the late reply. I need to review my Github notification settings!