-
Notifications
You must be signed in to change notification settings - Fork 296
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
contrib: Add Go multimod workspace setup script. #2904
contrib: Add Go multimod workspace setup script. #2904
Conversation
Looks good. One question - will |
Would be be desirable to also add the cmd app modules to the workspace? |
Perhaps in the main
I'm not sure what you mean here. The apps under cmd aren't separate modules. |
Ah, whoops, I have a couple in dcrdata/cmd as their own modules. My mistake. |
10ad619
to
47c1d48
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. The script works. I've switched to go workspaces and gopls recently and it's great.
---------------------- contrib/dcr_setup_go_workspace.sh ----------------------
new file mode 100755
index 00000000..82131267
This adds a script to the contrib directory that initializes a Go multi-module workspace and adds all of the modules provided by the dcrd repository to it on an as needed basis. Note that workspaces require Go 1.18+. This is useful when developing across multiple modules in the repository and allows development environments that make use of the Go language server (aka gopls), such as VSCode, to provide full support without also needing to temporarily create replacements in the various go.mod files or individually add every module. Do note, however, that workspaces are local, so final submissions to the repository will still require the appropriate changes to the relevant go.mod files to ensure resolution outside of the workspace. Finally, it also updates the README.md in the contrib directory accordingly.
47c1d48
to
cd1afb2
Compare
This adds a script to the
contrib
directory that initializes a Go multi-module workspace and adds all of the modules provided by thedcrd
repository to it on an as needed basis. Note that workspaces require Go 1.18+.This is useful when developing across multiple modules in the repository and allows development environments that make use of the Go language server (aka
gopls
), such as VSCode, to provide full support without also needing to temporarily create replacements in the variousgo.mod
files or individually add every module.Do note, however, that workspaces are local, so final submissions to the repository will still require the appropriate changes to the relevant
go.mod
files to ensure resolution outside of the workspace.Finally, it also updates the
README.md
in thecontrib
directory accordingly.