Go imports the package under the current project

In fact, it is similar to other languages

import (
    "../controllers" //This is to import the controllers in the previous directory
    "./models" //models in the same level directory
    "./models/entitys" //entitys in the current directory
    "../../routers" //routers of the upper two-level directory
)

Of course, you can also put the written component into the src of $GoPath, so you don't need to care which level the directory is, just call it like this:

import (
    "myproject/controllers" //This is the name of your own project + package name
)
{{o.name}}
{{m.name}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324148073&siteId=291194637