GOPATH required all Go code to live in a single workspace directory with no versioning. Go modules introduced go.mod for explicit versioning, reproducible builds, and support for any directory structure.
All Go code must live under $GOPATH/src/
No versioning — go get always fetches the latest commit
No reproducible builds — different developers could get different dependency versions
Cannot have multiple versions of the same dependency
Effectively deprecated — only use for very old codebases
go.mod declares module name, Go version, and direct dependencies with versions
go.sum contains cryptographic hashes for all dependencies — guarantees reproducibility
Module proxy (proxy.golang.org) caches modules — works even if the original repo is deleted
Private modules: set GONOSUMCHECK and GOMODCACHE for internal packages
Minimum version selection (MVS): Go always picks the minimum satisfying version, not the latest
You need to add a new third‑party library to a small Go project that currently uses GOPATH. How would you fetch and import it, and what would change if the project used Go modules instead?
If you run go build inside a directory that contains a go.mod file, what does the Go toolchain do differently compared to a directory without one?
Your CI script sets GOPATH and runs go get ./.... After adding a go.mod file the build fails. Why does this happen?
Your team is adding a new microservice that lives in a GOPATH‑based repo, but management wants to adopt Go modules for better versioning. What migration steps would you take and what pitfalls would you watch for?
During a release a dependency version conflict appears only when building with modules enabled. How would you diagnose and resolve it?
A build that succeeded on a developer’s machine using GOPATH started failing on the CI server after the CI switched to module mode. What could be causing the discrepancy?
You are designing a shared library that will be consumed by dozens of services across the company. How would you structure its repository and choose between GOPATH and Go modules to ensure reproducible builds and easy upgrades?
Our monorepo contains many legacy packages that still rely on GOPATH. Introducing modules caused duplicate import paths and version skew. How would you architect a migration strategy that minimizes disruption and supports incremental adoption?
Discuss the performance and caching implications of using a module proxy versus GOPATH vendoring in a large CI pipeline that runs thousands of builds per day.
The organization plans to deprecate GOPATH entirely and enforce module usage across all teams. What organization‑wide policies, tooling, and migration road‑map would you propose to handle legacy code, vendor directories, and external dependencies?
Consider multiple teams needing to share internal packages with different version requirements. How would you design a versioning and publishing strategy using Go modules that balances stability and flexibility, and what governance model would you put in place?
If you had to support both Go 1.13 (module‑aware) and older Go versions that only understand GOPATH, how would you architect the build system and repository layout to serve both without duplication?