Go Modules and Dependency Management

Review how to manage Go modules,versions,and dependencies.

1. Which command initializes a new Go module?
2. Which of the following are files or directories used in Go module management? (Select all that apply)
3. The go.sum file is optional and can be safely deleted without affecting builds.
4. What command is used to download and install a specific version of a dependency (e.g., example.com/[email protected])?
5. What is the purpose of the 'replace' directive in a go.mod file?
6. Which of the following commands help manage dependencies in Go modules? (Select all that apply)
7. When a 'vendor' directory exists in a Go module project, Go will always fetch dependencies from the internet instead of using the vendor directory.
8. What does the 'module' directive at the top of a go.mod file specify?
9. What action does 'go mod tidy' perform regarding unused dependencies?
10. What file in a Go module project lists the exact versions of all dependencies?
Answered 0 of 0 — 0 correct