Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UniqueName ¶
UniqueName renders an identifier as a filesystem-safe name that is injective: two distinct identifiers can never map to the same file. Flattening path separators alone made example.com/a/b and example.com/a_b collide, which let one package's tests silently execute another package's binary; the hash suffix carries the uniqueness, the readable prefix is for humans.
func WriteFile ¶
WriteFile marshals {"Replace": replace} into workdir/overlay.json and returns its path. A key whose on-disk path does not exist injects a brand-new file into the package — the compiler sees a file the source tree never contains.
func WriteUnderBasename ¶
WriteUnderBasename writes content to workdir/group/<basename(original)>, keeping the original file name because the go command derives build constraints — _linux, _amd64, _test — from the name it is given, not from the path being replaced.
Types ¶
This section is empty.