GoLand Cannot Resolve Imports / Go Modules Not Working

Share
Workaround available Windows, macOS, Linux Updated November 14, 2026Based on 4 user reportsHow we research

Quick answer

Turn on Go Modules integration, make sure a go.mod is found and reload modules. Deleting .idea and reopening also fixes stale state for many users.

Most likely fix: Enable modules integration

How to fix it

Try these in order — the most common fix is first.

  1. 1. Enable modules integration

    1. Open Settings | Go | Go Modules
    2. Enable Go Modules integration and disable GOPATH indexing
    3. Reload via the Go tool window or go mod tidy
    Did this fix it?
  2. 2. Reset IDE state

    1. Close the project
    2. Delete the .idea folder
    3. Reopen it or use File | Invalidate Caches
    Did this fix it?
  3. 3. Private modules

    1. Set GOPRIVATE and GOFLAGS in Settings | Go | Go Modules environment
    2. Check credentials work from the terminal
    Did this fix it?

Symptoms

Red "cannot resolve" or "unresolved reference" on imports even though go build works.

Why it happens

  • Go Modules integration disabled
  • go.mod not at the opened project root
  • GOPATH indexing conflicting with modules
  • Stale caches or .idea state
  • Private modules without GOPRIVATE or GOFLAGS set

This guide also covers

  • goland cannot resolve import
  • goland go modules not working
  • goland unresolved reference
  • goland cannot resolve directory

Still not working?

If GoLand keeps failing, you're not alone. See every GoLand problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us
Fixed it? Share this guide

The same problem in other apps

All storage, upload & download guides →

Other GoLand errors

All 10 GoLand errors and fixes →