I have the following project structure:
.
├── daos
│ ├── daos.go
│ ├── daos.iml
│ ├── go.mod
│ └── go.sum
├── entities
│ ├── entities
│ │ └── pets.go
│ ├── entities.iml
│ └── go.mod
└── pkg.iml
I want to import module entities
to daos
, but get the following error:
go: finding module for package github.com/goncharovmvdev/pets/entities/pets
github.com/goncharovmvdev/pets/daos imports
github.com/goncharovmvdev/pets/entities/pets: module github.com/goncharovmvdev/pets@latest found (v0.0.0-20220625073141-e49db91a04de), but does not contain package github.com/goncharovmvdev/pets/entities/pets
CodePudding user response:
If you want to import the entities to daos, there are 2 ways:
- Push the entities' source code to your Github.
- You can use the replace directive like this (https://go.dev/doc/tutorial/call-module-code)