I need help, I'm working in the go workspace and there are multiple projects in the workspaces using the common functionality. So, What I did is to make a separate module that contains all the common functionalities that are used by the other modules.
All modules can share their code as we are using the go workspace.
The file structure is as follows:
Workspace
│
├── Project1
│ ├── main.go
│ ├── docker-compose.yml
│ ├── Dockerfile
│ └── go.mod
│
├── Project2
│ ├── main.go
│ ├── docker-compose.yml
│ ├── Dockerfile
│ └── go.mod
│
├── Common
│ ├── functionality.go
│ └── go.mod
│
└── go.work
Project1 and Project2 use the functionalities that are in the common/functionality.go
by importing them into the project.
when I run the docker-compose up -d
command in project1
It says the common module that you import in the project is not in the GOROOT.
because here docker only containerizes the files that are in the directory Project1
How can I dockerize separately Project1
and Project2
???