testbin

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testbin builds a Go executable for tests that need one with build information in it. The test binary itself is not a reliable stand-in: before Go 1.27 the go command generated a test binary's build information before wiring up the test main's imports, so the module list in it came out empty (cmd/go/internal/load/test.go regenerates it after the imports since 1.27). A decomposer reading such a binary finds no dependencies.

Index

Constants

View Source
const Package = "github.com/carabiner-dev/unpack/internal/testbin/fixture"

Package is the import path of the fixture program.

Variables

This section is empty.

Functions

func Build

func Build(t *testing.T) (string, *debug.BuildInfo)

Build returns the path of the fixture executable and the build information it carries, compiling it the first time a test of the package asks for it. Every test gets the same executable, so tests must treat it as read-only: copy it to change it.

The build runs with VCS stamping off, so the main module is always (devel) and the result does not depend on the state of the checkout. It is not trimmed (-trimpath) so it reuses the packages the go command already compiled for the test binary instead of compiling them again. The executable lives in a directory of its own in the system temporary directory, which outlives the tests that share it and is not removed.

Types

This section is empty.

Directories

Path Synopsis
Command fixture is a tiny Go program the tests build to get an executable with module dependencies in its build information.
Command fixture is a tiny Go program the tests build to get an executable with module dependencies in its build information.

Jump to

Keyboard shortcuts

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