Directory structure:
src
go.mod
lib/migrate
migrate.go
/driver/source
local.go
I'm trying to import local
in migrate.go
like this:
package migrate
import (
local "app/lib/migrate/driver/source/local"
)
type Migrate struct {
}
And I'm receiving this error:
could not import app/lib/migrate/driver/source/local (no required module provides package "app/lib/migrate/driver/source/local")
I checked the below items:
module app
package local
to get what you want, you have two options:
local "app/lib/migrate/driver/source/local"
with local "app/lib/migrate/driver/source"
local.go
inside it and replace the import to "app/lib/migrate/driver/source/local"
, (I don't recommend this one!)I recommend to always use folder name as package name, in your case import "app/lib/migrate/driver/source"
and use source
to get to local.go
exported things.