While working on Go projects in GoLand IDE, you might pull in dependencies from github.com just fine — they download, import correctly, and go mod tidy runs without issues. But then GoLand throws a fit: “Cannot resolve directory ‘github.com’”.
The culprit? Head to Settings > Go > Go Modules, and tick the “Enable Go modules integration” box.

If it’s unchecked, that’s your problem. Simple as that.