|
| 1 | +--- |
| 2 | +title: A guide to risky changes to the standard library and toolchain |
| 3 | +--- |
| 4 | + |
| 5 | +Please take special care when working on **risky changes**. |
| 6 | +As a reminder: |
| 7 | + |
| 8 | +A change is risky if it can cause **failures that are hard to diagnose** (for example, changes to |
| 9 | +the runtime, GC, compiler, linker, TLS, other low-level component, or **complex changes that |
| 10 | +need soak time under production workloads**), or if it **requires many CLs that are hard to |
| 11 | +revert** (for example, large CLs or stacks of CLs). |
| 12 | + |
| 13 | +If you plan on working on a change that may be risky, please do the following: |
| 14 | +1. Unless the entire change is absolutely trivial to revert, protect the new code paths with a |
| 15 | + boolean flag, prefixed with "go125", that can be used to quickly toggle back to the old |
| 16 | + implementation. |
| 17 | + It can be a simple bool constant, for example, const go125UseEvenBetterLinker = true. |
| 18 | + Such flags **must be findable** by a simple grep for the string "go125". |
| 19 | + That way we can find them without missing any, and they can be cleaned up when we get to the |
| 20 | + Go 1.26 cycle. |
| 21 | +2. Consider how you would answer the following questions for your change: |
| 22 | + * How risky is the change you're planning to make? |
| 23 | + * How will you know if it is working as intended? |
| 24 | + * How much production testing does it need for you to be confident it is working as intended? |
| 25 | + * When should the keep/revert decision be made? |
| 26 | +3. Create a tracking issue in the Go 1.25 milestone with a release-blocker label. |
| 27 | + This issue will be used to track progress on the feature and make the final decision for Go 1.25. |
0 commit comments