Why use internal package and main package in the same module?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. Vegeta

    HTTP load testing tool and library. It's over 9000!

    A module can be an executable and a library at the same time. For example, https://github.com/tsenart/vegeta

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. sqlc

    Generate type-safe code from SQL

    I’ve seen people put automatically generated code (e.g. from https://sqlc.dev/ or https://entgo.io/) inside a sub-internal package (e.g. db/internal) with the intention of never exposing it to the rest of the code. The rest of the code works with structs and functions exported by the parent package, which internally delegated to the generated code.

  4. ent

    An entity framework for Go

    I’ve seen people put automatically generated code (e.g. from https://sqlc.dev/ or https://entgo.io/) inside a sub-internal package (e.g. db/internal) with the intention of never exposing it to the rest of the code. The rest of the code works with structs and functions exported by the parent package, which internally delegated to the generated code.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • A practical approach to structuring Golang applications

    10 projects | dev.to | 3 Oct 2022
  • Set up golang project on m3 (2025)

    1 project | dev.to | 4 Feb 2025
  • I made SQL easy in Go

    2 projects | dev.to | 2 Feb 2025
  • Show HN: Gurubase – AI-Powered Q&A Assistants for Any Topic

    2 projects | news.ycombinator.com | 21 Jan 2025
  • [Bahasa] Tracer: Open Telemetry, Golang, and Jagger Simple Implementation

    3 projects | dev.to | 15 Jan 2025

Did you know that Go is
the 4th most popular programming language
based on number of references?