# M0023 import cycle (/docs/diagnostics/codes/m0023)

Go does not allow import cycles. Move the shared code into a third package that both import.

## The mistake and the fix [#the-mistake-and-the-fix]

<div className="code-pair">

```go title="The mistake"
// package a imports b, package b imports a
```

```go title="Fixed"
// move what both need into package c; a and b import c // [!code highlight]
```

</div>

See also [all error codes](/docs/diagnostics/codes) and [marmot explain](/docs/commands/explain).