@@ -249,6 +249,47 @@ Go Modules Reference.
249
249
See “[Go toolchains](/doc/toolchain)” for details about how the `toolchain` line
250
250
affects Go toolchain selection.
251
251
252
+ ## godebug {#godebug}
253
+
254
+ Indicates the default [GODEBUG](/doc/godebug) settings to be applied to the main packages of this module.
255
+ These override any toolchain defaults, and are overridden by explicit `//go:debug` lines in main packages.
256
+
257
+ ### Syntax {#godebug-syntax}
258
+
259
+ <pre>godebug <var>debug-key</var>=<var>debug-value</var></pre>
260
+
261
+ <dl>
262
+ <dt>debug-key</dt>
263
+ <dd>The name of the setting to be applied.
264
+ A list of settings and the versions they were introduced in can be found at [
265
+ GODEBUG History](https://go.dev/doc/godebug#history).
266
+ </dd>
267
+ <dt>debug-value</dt>
268
+ <dd>The value provided to the setting.
269
+ If not otherwise specified, `0` to disable and `1` to enable the named behavior.</dd>
270
+ </dl>
271
+
272
+ ### Examples {#godebug-examples}
273
+
274
+ * Use the new 1.23 `asynctimerchan=0` behavior:
275
+ ```
276
+ godebug asynctimerchan=0
277
+ ```
278
+ * Use the default GODEBUGs from Go 1.21, but the old `panicnil=1` behavior:
279
+ ```
280
+ godebug (
281
+ default=go1.21
282
+ panicnil=1
283
+ )
284
+ ```
285
+
286
+ ### Notes {#godebug-notes}
287
+
288
+ GODEBUG settings only apply for builds of main packages and test binaries in the current module.
289
+ They have no effect when a module is used as a dependency.
290
+
291
+ See “[Go, Backwards Compatibility, and GODEBUG](/doc/godebug)” for details on backwards compatibility.
292
+
252
293
## require {#require}
253
294
254
295
Declares a module as a dependency of the current module, specifying the
0 commit comments