Nov 26, 2026
17 min read
0 views

In a pre-registered random sample of 20,000 Go modules, 1.34% had a retract directive in the go.mod of the version the public proxy calls latest. That figure is biased both downward and upward, by amounts we cannot size. The main question, how long after publication a version is retracted, was not answered: a stop rule written before collection fired, and this article explains why.
Glasp Research. Keisuke Watanabe, Glasp Inc.
Go 1.16, released on 16 February 2021, gave module authors a way to withdraw a published version without deleting it. The author adds a retract line to go.mod and publishes a new version. The retracted version stays downloadable, so existing builds keep working, but the go command stops choosing it on its own.
We wanted to know three things: how often the directive is used, how long after a version's publication it is retracted, and whether other modules keep requiring retracted versions. The second question was the main one. We did not get an answer to it.
Of 19,809 sampled modules whose latest go.mod we could read, 265 contain retract: 1.34% (95% CI 1.19% to 1.51%). Over all 20,000 sampled modules the share is 1.325% (1.176% to 1.493%). For reasons explained below, this share is biased in both directions, and we do not know the size of either bias.
In those 265 modules, 1,502 of 18,680 listed tagged versions are covered by a retract entry: 8.0% (95% CI 5.4% to 11.8%).
The modules contain 635 retract entries. Between 368 and 422 of them carry a comment, depending on how a comment placed above a block of entries is counted.
Of 186 require lines in the sample that point at a retracting module, 2 name a retracted version: 1.1% (95% CI 0.0% to 2.8%). The interval is wide.
The time from publication to retraction was not computed. Not as a median, not as a share within seven days, not for any subgroup.
Sampled modules with a readable latest go.mod: 19,809
Of these, with a retract directive: 265, or 1.34% (1.19% to 1.51%)
Listed tagged versions in those 265 modules: 18,680
Of these, covered by a retract entry: 1,502, or 8.0% (5.4% to 11.8%)
Retract entries: 635 (521 single versions, 114 ranges)
Entries with a comment: 368 to 422 (see below)
Retraction is usually small. Across all 265 retracting modules, including the 57 that have no retracted version in the proxy's list, the median number of retracted versions is 2. The 90th percentile is about 13 (12.6, interpolated between two modules) and the maximum is 326.
Ranges do most of the work. There are far fewer range entries than single entries, but 1,120 of the 1,502 retracted versions are covered by a range entry (one of them also by a single entry).
Many entries point at nothing the proxy lists. 154 of the 635 entries cover no version in the proxy's version list, and 57 of the 265 retracting modules have no retracted version in that list at all. At the other end, in 11 modules every listed tagged version is retracted.
Comments are common but not universal, and the count depends on a definition our plan did not fix. The first analysis found 368 of 635 entries with a comment. An independent recomputation from the raw files found 422 (66.5%) when a comment above a retract ( ... ) block is applied to every entry in the block, and 230 when only a comment on the entry's own line counts. The difference between 368 and 422 is 54 entries in 8 modules that sit under such a block comment. We report the range and not one figure. We counted comments as present or absent only and did not read or classify them, so we cannot say how many of them give a reason. The Go documentation recommends a comment that explains the retraction and says the go command may show it to users.
The plan defined two times for each retracted version. P is when the proxy first cached the version, taken from the public index. R is the index time of the earliest version of the same module whose go.mod retracts it. The outcome was R minus P in days.
Finding R means reading older go.mod files of the same module one by one, in index order, until one of them contains the retraction. To keep the load on the proxy bounded, the plan capped this at 100 go.mod fetches per module.
The plan also said, before any study data were collected (only a 150-module feasibility sample, disclosed in the plan, had been seen): if more than 30% of retracted versions end up with no R, report the data failure instead of the timing quantiles.
That rule fired. 662 of 1,502 retracted versions have no retraction time: 44.1%, against the 30% limit. We give no interval for this share, because the stop rule is a threshold on a count and the versions are clustered in few modules. The 662 fall into three groups.
The cap was reached: 436 versions in 22 modules. These modules list between 128 and 615 tagged versions (median 274.5). 179 of the 436 are in one module and 316 are in five.
No publication time: 166 versions in 14 modules. The proxy lists these versions, but the index has no row for them before the snapshot end, and the proxy's .info file for each returned 404. 147 of the 166 are in one module, and 148 are pre-release versions. We did not establish why. One candidate cause, named in the plan, is described under Limits.
The scan ended without finding the retraction: 60 versions in 31 modules. For 51 of them, the latest version, which carries the directive, has an earlier index time than the retracted version itself, so a scan that only looks forward in index time cannot find it. For 5, the latest version is a pseudo-version, and for 4 the latest version has no index row before the snapshot end. The scan reads only tagged versions that have an index row before the snapshot end.
The rule's wording, "unresolved R (cap hit or missing index rows)", can be read more than one way. We show all the readings.
Every version without R (the one used): versions 662, 44.1%, over 30% yes
Without the 51 whose directive is older in index time: versions 611, 40.7%, over 30% yes
Cap reached, or scan ended without the retraction: versions 496, 33.0%, over 30% yes
Cap reached only (the narrowest): versions 436, 29.0%, over 30% no
Only the narrowest reading stays under the limit, by one point. The widest reading was set in the analysis code before the stop rule was evaluated; the written record of that choice dates from after the run, and the code was run four times with identical stop-rule counts. It is the reading most likely to stop us, and we treated the rule as fired.
The failure is concentrated. Of the 208 modules that have retracted versions, 61 have at least one without R and 25 have none with R. The rule is defined on versions, so this does not change the outcome.
840 versions in 183 modules do have both times. We did not subtract one from the other. That was deliberate. The cap removed 436 versions in 22 modules, all with 128 to 615 listed versions; the remaining 840 under-represent such modules. (68 of the 265 retracting modules list more than 100 tagged versions, so the cap was reached in 22 of those 68 and not in the others.) A median computed on the 840 would not be the estimate the plan registered. Looking at it and then deciding whether to report it is the thing a stop rule exists to prevent.
The plan had a secondary outcome called self-retraction: the share of retract entries that cover the very version that contains them. This is how an author withdraws an accidental release. The new version retracts the bad one and itself.
The registered count came out as 0 of 635 entries. We do not report that as "0%".
A zero is first a statement about the instrument. So we ran the same test on go.mod files of non-latest versions that the timing scan had already stored. Of 4,894 such files, 1,751 contain retract, and 38 of them (in 35 modules) contain an entry that covers their own version. 23 of those versions are higher than the version the proxy returned as latest.
In 32 of the 265 retracting modules, the version returned by the proxy's @latest endpoint is below the highest tagged version in the proxy's own list. For 25 of those 32 the scan had stored the go.mod of that highest version, and in 19 of the 25 it retracts itself.
So the test finds self-retraction in stored files. In those 19 modules the zero is consistent with the @latest endpoint not returning a version that retracts itself. The other 13 of the 32 are unexplained: in 6, the stored go.mod of the highest version does not retract itself and @latest is still below it, and in 7 that go.mod was not stored, so we could not look. With "latest" defined as whatever that endpoint returns, the registered measure could not come out above zero if the endpoint behaves as the go command's query does, which our data suggest but no document states.
The analysis was run offline, so this explanation was first stated from the data alone. We then read the Go Modules Reference on 27 November 2026. It confirms the explanation for the go command. The sentence is:
"A version containing retractions may retract itself. If the highest release or pre-release version of a module retracts itself, the
@latestquery resolves to a lower version after retracted versions are excluded."
The same section also says, in our paraphrase, that retracted versions are left out when version queries such as @latest are resolved, and that the go command itself reads a module's retractions from its highest version, even if that version is retracted.
One gap remains. Those sentences describe the go command's version query. Our collection called the proxy's HTTP endpoint of the same name. The reference describes that endpoint as returning metadata about the latest version of the module that the proxy knows, and does not mention retractions there. The proxy.golang.org page does not describe the endpoint's handling of retracted versions either. So the documentation confirms the behaviour we inferred, for the command. That the proxy endpoint behaves the same way is what our data suggest, not something we found written down.
A module counts as retracting in this study only if the go.mod of the version returned by @latest contains retract. That rule misses some modules and counts some paths more than once.
Downward. Take a module whose only retract directive sits in a version that retracts itself. The proxy returns a lower version as latest. That lower version's go.mod was written before the retraction and need not contain the directive. The module is then counted as not retracting. The 19 modules above are counted among the 265 only because the version @latest returned also carried a retract directive. Modules where that version carries none are invisible to this design, and we cannot say how many there are. Retractions that were later removed from go.mod are missed as well.
Upward. The sample is a sample of module paths, and one piece of code can be published under several paths. A fork, a mirror host or a second spelling of the same path serves a go.mod that its owner may have inherited unchanged, retract lines included. Such a path counts as a retracting module here although nobody retracted anything under that path.
We counted one kind of duplicate offline, after the review of this draft: module paths that differ only in letter case. The proxy treats them as different modules. In the 20,000 sampled paths there are 88 groups of such paths, holding 450 paths (three of the groups hold 270 of them). Among the 265 retracting modules there are 2 such groups of 2 paths each, so 4 of the 265 are case variants of another retracting module in the sample. Counting each group once gives 263 retracting among 19,638 paths, which is 1.34%, against 1.325% of all 20,000. Letter case alone does not move the figure.
Forks and mirrors under different names are not caught by that count, and we did not check for them. The 154 entries that cover no listed version, and the 57 retracting modules with no retracted version in the proxy's list, are what an inherited directive would look like (a retract line naming versions that this path never published), but they have other possible causes and we did not test which applies.
So the share is too low by the modules the design cannot see and too high by the paths that carry someone else's directive. Neither size is known, and we do not say which is larger.
The plan allowed the sentence "retraction is rarely used among sampled Go modules" only if the share was below 1% with an upper bound below 2%. The share is not below 1%, so we do not use that sentence.
Rarely in this sample, and with little precision. Across the 20,000 latest go.mod files, 186 require lines point at a retracting module (92 direct, 94 indirect). They come from 157 modules and reach only 19 of the 265 retracting modules.
2 of the 186 require lines name a retracted version: 1.1% (95% CI 0.0% to 2.8%, cluster bootstrap over the 157 requiring modules). The two lines are in two different modules and both are indirect requirements. The interval is wide: with two events it runs from zero to more than twice the point value, and we do not compare it with anything.
We found no published measurement of the Go retract directive in an open-web and arXiv search on 14 November 2026. That search did not cover paywalled library search tools, so a study could exist that we did not find.
The closest published analogue is for Rust. "An Empirical Study of Yanked Releases in the Rust Package Registry" (arXiv 2201.11821) reports, on data from October 2020, that 3.7% of Cargo releases were yanked and that 9.6% of Cargo packages had at least one yanked release. Yanking and retraction are different mechanisms, measured here in different ways, so these numbers are context and not a comparison.
Registration. The plan was committed to version control at 18:16:51 UTC on 19 November 2026. The first collection request went out at 18:20:52 UTC the same day. The plan fixed the sample, the outcomes and four stop rules.
Frame. 1,028,231 module paths with at least one tagged version in the public index from 16 February 2021 up to the start of 19 November 2026 (UTC), from 61,310,000 index rows.
Sample. 20,000 paths drawn at random with a fixed seed, saved before any proxy request.
Per module. The proxy's @latest, then the go.mod of that version. For modules with retract: the version list, and a scan of older go.mod files capped at 100 fetches per module.
Intervals. Wilson 95% for shares of modules. Cluster bootstrap over modules (10,000 resamples, percentile, 95%) for shares counted over versions and over require lines. No interval is given for the stop-rule share of 44.1%.
Requests. One at a time, at least 1.1 seconds apart, no login. 76,965 requests in the completed run (16 more in three aborted starts), which ended on 21 November 2026. Of 45,136 proxy URLs, 44,784 returned 200 and 352 returned 404. None returned 429.
Collection code. The collection script that produced the data was changed once after registration, before any data were saved, so that truncated responses are retried under the registered retry rule; no question, threshold or pacing changed. A second change, to how requests are sent, was written after that and was not used by the completed run.
Stop rules. Too few retracting modules (under 100): not fired, 265. Too many versions without a retraction time (over 30%): fired, 44.1%. Too few require lines on retracting modules (under 100): not fired, 186. Any rate-limit pattern: not fired.
Analysis. Run on 26 November 2026 (UTC) on stored files, with the stop rules evaluated before any outcome. The analysis code was run four times that day, with identical stop-rule counts. The written record of the analysis choices dates from after the run.
No timing result exists. Nothing here says how fast retractions happen.
Prevalence is biased in both directions. Downward: self-retracting latest versions and retractions later removed from go.mod are missed. Upward: forks, mirrors and case-variant module paths that carry inherited directives are counted. Neither size is known. Only letter-case variants were counted (4 of the 265).
The proxy endpoint's behaviour is inferred. The documentation describes the go command's @latest query. We did not find a written description of how the proxy's @latest endpoint treats retracted versions. In 13 of the 32 modules where @latest is below the highest listed version, self-retraction is not shown to be the cause.
The fetches came after the snapshot end. @latest and the version lists were fetched on 20 and 21 November 2026 (UTC), about two to three days after the snapshot end. Versions published or first cached in that gap, possibly by our own requests, have no index row before the end. The plan named this risk before collection. Whether it explains the 166 was not tested.
The frame is what the public proxy has cached. Private modules and modules never fetched through proxy.golang.org are outside it. The proxy's own page says it does not keep every module indefinitely. 191 sampled modules could not be read, 185 of them because @latest returned 404.
Index time is not tag time. The index records when the proxy first cached a version. The 51 versions whose directive-carrying latest version has an earlier index time than the retracted version show that this order can be reversed.
Three things are unexplained. The cause of the 166 versions with no publication time, the 13 modules where @latest is below the highest listed version without a shown self-retraction, and the size of the bias in prevalence in either direction.
Some choices were made after the plan. How to read "unresolved", which denominator to show for prevalence, and the check on the self-retraction zero are recorded as dated deviations. The instrument check and the letter-case count were not registered. The letter-case count and the wording on bias were added after a review of this article, with the outcomes already known.
Comments were not read. A present comment is not shown to give a reason.
Not rechecked in the analysis. The index rows were not read a second time; the frame size is taken from the sample record.
No causes. We do not claim that retraction does or does not change what other modules depend on.
A timing study would need a new registration with a different scan: no cap, or a scan from the newest version backwards, reading retractions from the highest listed version instead of from @latest, and a rule for versions without an index row. The present sample cannot be enlarged or rescanned under this plan.
All pages below were read on 27 November 2026 unless a line says otherwise. Only the block quote in "What the documentation says" was compared word for word with its page. Everything else from these pages is paraphrased.
Go Modules Reference, sections "retract directive", "Version queries", "go list -m" and "GOPROXY protocol":
Go 1.16 release notes. They introduce retract directives in go.mod as a way to mark published versions of a module that other modules should not use.
Go release history, for the date of Go 1.16 (2021-02-16):
https://go.dev/doc/devel/release
Go blog, "New module changes in Go 1.16", 18 February 2021:
https://go.dev/blog/go116-module-changes
Module proxy and index documentation. The index page describes its timestamp as the time the proxy first cached the version.
"An Empirical Study of Yanked Releases in the Rust Package Registry", arXiv 2201.11821:
https://arxiv.org/abs/2201.11821
Not verified, and so not stated as fact in this article:
A 2021 journal study of release deprecation in npm, named in our prior-work notes. The PDF and the publisher page could not be read on 27 November 2026.
Three Go ecosystem papers (arXiv 2606.26291, 2401.00515, 2309.02894). We opened their abstracts on 27 November 2026 and none mentions retraction. The full texts were searched on 14 November 2026 and not again.
How the proxy's @latest HTTP endpoint is specified to treat retracted versions. No documentation found.
Whether any of the 265 retracting module paths is a fork or a mirror of another module.
This article was researched and written by Claude (an AI model by Anthropic) in a Glasp research run. The collection and the analysis were run with AI assistance. No Glasp user data was used. The plan was committed before the first request. Every number in this draft was compared with the run's result files by the same model. A second run recomputed the main counts from the raw files with separately written code, without reading the first analysis code: the sample and prevalence figures, the 1,502 of 18,680 versions, the 635 entries and their split into single versions and ranges, the stop-rule count and its three causes, the require-line counts (the 2 of 186 included) and the self-retraction counts all matched. The comment count did not match and is given as a range above. For this revision the per-module distribution (median, 90th percentile, maximum) and the 68 modules with more than 100 tagged versions were recounted from the collection's per-module file, not from the raw files, and matched. Not recomputed: the bootstrap intervals on the 8.0% and the 1.1%, the split of the 60 into 51, 5 and 4, the count of entries with no listed retracted version as grouped here, and the 32, 25 and 19 in the @latest section. A pre-publication review, run as a separate AI session that did not write the draft, found 19 points; this draft answers them. No human has checked the figures yet.