Documentation
¶
Overview ¶
Package linktest provides cross-platform managed-link fixtures for tests.
dot-agents historically created link fixtures with os.Symlink, which fails on Windows without SeCreateSymbolicLinkPrivilege (Developer Mode / admin). The production link model uses junctions (dirs) and hard links (files) on Windows; test fixtures must mirror that so the contract checks (links.IsManagedLink / CollectBrokenUserLinks / doctor repair) see the same shapes they will in the field.
Use Link for a valid managed reference and DanglingLink for a broken one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DanglingLink ¶
DanglingLink creates a broken managed link at link and returns the absolute target path it references, which does not exist (so the link is "dangling"). Callers that assert the resolved target should compare against the returned value rather than a hard-coded path, since the Windows junction mechanism dictates the concrete target location.
POSIX: a symlink to a never-created path under a temp dir. Windows: a junction created against a real temp dir which is then removed, leaving a reparse point whose target is gone — the closest analogue, since a hard link cannot dangle (its target must exist).
Types ¶
This section is empty.