import cycle not allowed

0

Good morning, I'm debugging a system that is made in kataras / iris the framework for Go, running in terminal my go run main.go I get the following error

import cycle not allowed
package main
        imports ./src/Controladores/ExpresionRegularControler
        imports ../../Modelos/ExpresionRegularModel
        imports ../../Modulos/General
        imports ../../Modelos/ExpresionRegularModel

What could I change to recognize the routes and my imports?

    
asked by Fatima Reyes 26.09.2017 в 15:38
source

2 answers

0

The import must always be done from src.

If my package code A wants to use it in package B the two codes must be in the src folder and in different folders and for the import it must be placed from the src folder

file path /src/codigoA/a.go with package A (package A) - >

import "/codigoA/A"

I hope it was helpful

    
answered by 17.01.2018 в 15:11
0

That error is thrown when you are importing the same file more than once you are creating an import cycle. You just have to check where this import is being duplicated

  

imports ../../ Models / ExpresionRegularModel

    
answered by 14.01.2019 в 21:00