4

Suppose I have a go project that includes many package. in example we can see this

-Project
---A
----aa
----ab
---B
----ba
----bb

Now while coding If i need to use methods of package aa into my bb package the standered way is to import like

import "github.com/user/project/A/aa"

But I have seen this package importing supports also relative import like

import "./../../A/aa"

That will also import that package and allow mw to use the methods.

Now my question is - I didn't see any one importing like this. So is this type of relative importing is prohibited? or it is allowed but using this is only a bad practice of coding?

sadlil
  • 3,077
  • 5
  • 23
  • 36
  • 2
    Relative imports generate more problems than they solve. Search the golang-nuts mailing list for lots of discussions about it. – Volker Oct 16 '15 at 05:15

0 Answers0