binaryfile

command
v0.3.0-20261120180237-... Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 7 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

Command binaryfile checks that no binary file is tracked in the repository.

The build is Bazel-driven and every artifact it produces lands in an ignored directory — bazel-bin/, bin/, or .docker-bin/ — so a tracked binary is always a mistake. The usual cause is an ad-hoc `go build ./service/...` run from the repo root: it names its executable after the package directory and writes it to the working directory, where a broad `git add` sweeps it up.

Checking rather than ignoring is deliberate. A .gitignore entry would stop the file being committed but would also stop git mentioning it at all, so the mistake becomes invisible and the stray artifact simply accumulates. A check that fails names the file and says what to do instead.

Detection follows git's own heuristic: a file is binary if a NUL byte appears in its leading bytes.

Jump to

Keyboard shortcuts

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