internal/

directory
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2026 License: MIT

README

internal/

Private packages of the Paper module. Two conventions in here are deliberate and worth knowing before contributing.

Vendored test infrastructure — why not testify?

The root module must stay free of third-party test dependencies so that consumers of github.com/avdoseferovic/paper never inherit them through go.mod. That is the entire reason these four packages exist:

Package Replaces
internal/assert testify/assert (non-fatal assertions)
internal/require testify/require (fatal assertions)
internal/mocktest testify/mock (runtime for generated mocks)
internal/goleak go.uber.org/goleak (goroutine leak detection)

Do not introduce testify (or any other test framework) into the root module. Generated mocks in internal/mocks/ are rewritten from testify to internal/mocktest by make mocks (see internal/cmd/mockfix).

Test helpers

internal/test is the canonical golden-structure test helper (PaperTest.Equals against test/paper/*.json snapshots). The public pkg/test package is a thin re-export of it for library consumers.

The embedded PDF engine

internal/pdf is a gofpdf-derived PDF writer owned by this repository. It is intentionally self-contained; application code must depend on Paper's public packages, never on internal/pdf directly.

Directories

Path Synopsis
Package assert provides lightweight test assertions used by the root module.
Package assert provides lightweight test assertions used by the root module.
cmd
mockfix command
Command mockfix rewrites generated mocks in internal/mocks so they import the vendored mock runtime (internal/mocktest) instead of testify.
Command mockfix rewrites generated mocks in internal/mocks so they import the vendored mock runtime (internal/mocktest) instead of testify.
Package goleak provides a small goroutine leak check for this repository's tests.
Package goleak provides a small goroutine leak check for this repository's tests.
Package mock provides the small mock API subset used by generated internal test mocks.
Package mock provides the small mock API subset used by generated internal test mocks.
Package pdf contains Paper's internal PDF runtime.
Package pdf contains Paper's internal PDF runtime.
Package providers contains repository-wide provider guard tests.
Package providers contains repository-wide provider guard tests.
Package require provides fail-fast test assertions used by the root module.
Package require provides fail-fast test assertions used by the root module.
Package svg provides in-process SVG rasterisation helpers for PDF image embedding.
Package svg provides in-process SVG rasterisation helpers for PDF image embedding.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL