Fixing GoLand’s “Cannot Resolve Directory ‘github.com'” Error

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.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注