{"id":18293935,"url":"https://github.com/tutorialedge/go-project-layout","last_synced_at":"2026-03-19T03:45:31.028Z","repository":{"id":97079992,"uuid":"378922625","full_name":"TutorialEdge/go-project-layout","owner":"TutorialEdge","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-28T14:29:51.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-06T02:22:46.718Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TutorialEdge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-06-21T12:27:04.000Z","updated_at":"2022-04-27T16:06:01.000Z","dependencies_parsed_at":"2023-04-19T15:01:46.026Z","dependency_job_id":null,"html_url":"https://github.com/TutorialEdge/go-project-layout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TutorialEdge/go-project-layout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TutorialEdge%2Fgo-project-layout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TutorialEdge%2Fgo-project-layout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TutorialEdge%2Fgo-project-layout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TutorialEdge%2Fgo-project-layout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TutorialEdge","download_url":"https://codeload.github.com/TutorialEdge/go-project-layout/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TutorialEdge%2Fgo-project-layout/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29199519,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T14:35:27.868Z","status":"ssl_error","status_checked_at":"2026-02-07T14:25:51.081Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T14:26:43.341Z","updated_at":"2026-02-07T16:03:11.235Z","avatar_url":"https://github.com/TutorialEdge.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"Go Project Layout\n==================\n\nThis repository contains an example as to how I would typically structure my Go applications.\n\n\u003e Note - This is not a silver-bullet approach and flatter project structures may suit you if you are writing lightweight applications.\n\n## Directory Overview\n\n### cmd\n\nThis directory contains the entrypoints to our Go applications. The code in these files should be purely focused on the instantiation and the tearing down of our applications.\n\nWe can create subdirectories for each of the distinct types of entrypoints we require:\n\n```output\n- cmd/\n  - server/\n    - main.go\n  - client/\n    - main.go\n  - cli/\n    - main.go\n```\n\n### deploy\n\nThe `deploy` directory tends to contain files such as my kubernetes service and deployments. \n\n### internal\n\nThis directory should contain all of the internal implementation details that we do not wish to expose to other Go projects. \n\nI tend to the majority of my application code within an `internal` directory when I write HTTP or gRPC services as it's highly unlikely these packages will ever be imported and used by other Go projects.\n\nTypically the internal directory ends up looking something like this:\n\n```output\n- internal/\n-  clients/\n-  - client.go\n-  database/\n-  - database.go\n-  service/\n-  - service.go\n-  - service_test.go\n-  transport/\n-  - http/\n-    - http.go\n-  - grpc/\n-    - grpc.go\n``` \n\n### migrations\n\nThis directory contains all of the database migrations that my application will ultimately run against an underlying persistance layer. For example, if my app required a SQL-based database, this would contain all of the SQL migration files needed to create tables and alter columns etc.\n\n### tests\n\nThis directory contains all of the E2E acceptance tests for our application. These tests should effectively treat our service as a black box and exercise all of the various API endpoints or equivalent for our applications.\n\n```output\n- tests/\n  - api_test.go\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftutorialedge%2Fgo-project-layout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftutorialedge%2Fgo-project-layout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftutorialedge%2Fgo-project-layout/lists"}