Add an explicit module requirement.
Section: Editing and Replacements
Add require directive
bash
bash
go mod edit -require example.com/lib@v1.2.3Explanation
Add an explicit module requirement. Useful in Go CLI workflows.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Editing and Replacements