Go run failing with error ```import cycle not allowed package main imports fmt imports errors imports runtime imports internal/bytealg imports internal/cpu imports runtime```

error msg

package main
       imports fmt
       imports errors
       imports runtime
       imports internal/bytealg
       imports internal/cpu
       imports runtime

I have set my goroot as /usr/local/go
followed this https://github.com/restic/restic/issues/534 as well but getting same error.

Can you provide the sample code that you’re using that’s causing this error?

1 Like

That’s a cyclical set of import dependencies, which is not allowed, your package imports X package which imports Y package which imports X package,

check yours imports and, compile again to identify which package you import many times

It was fixed by updating the golang thanks.