I'm trying to create a clean architecture API in Go but I'm confused with package logic. Here's the structure of the project.
main.go <- package main
├── delivery/
│ ├── endpoints/
│ │ ├── users.go <- package endpoints (I want to import ./repository here)
│ │ └── home.go <- package endpoints
│ ├── router.go <- package delivery
│ ├── middleware.go <- package delivery
├── repository/
│ ├── database.go <- package repository
│ └── fetchUsers.go <- package repository
In router.go
file I can access and import endpoints like this import "./endpoints"
, but when I try to import repository package inside users.go
or inside home.go
I get an error. Is there a way to access repository from files that are in endpoints folder?