go.internal.godebug
1.24.13.2
dotnet add package go.internal.godebug --version 1.24.13.2
NuGet\Install-Package go.internal.godebug -Version 1.24.13.2
<PackageReference Include="go.internal.godebug" Version="1.24.13.2" />
<PackageVersion Include="go.internal.godebug" Version="1.24.13.2" />
<PackageReference Include="go.internal.godebug" />
paket add go.internal.godebug --version 1.24.13.2
#r "nuget: go.internal.godebug, 1.24.13.2"
#:package go.internal.godebug@1.24.13.2
#addin nuget:?package=go.internal.godebug&version=1.24.13.2
#tool nuget:?package=go.internal.godebug&version=1.24.13.2
go.internal.godebug
C# package converted from the Go standard library by go2cs.
Package godebug makes the settings in the $GODEBUG environment variable available to other packages. These settings are often used for compatibility tweaks, when we need to change a default behavior but want to let users opt back in to the original. For example GODEBUG=http2server=0 disables HTTP/2 support in the net/http server.
In typical usage, code should declare a Setting as a global and then call Value each time the current setting value is needed:
var http2server = godebug.New("http2server")
func ServeConn(c net.Conn) {
if http2server.Value() == "0" {
disallow HTTP/2
...
}
...
}
Each time a non-default setting causes a change in program behavior, code must call [Setting.IncNonDefault] to increment a counter that can be reported by runtime/metrics.Read. The call must only happen when the program executes a non-default behavior, not just when the setting is set to a non-default value. This is occasionally (but very rarely) infeasible, in which case the internal/godebugs table entry must set Opaque: true, and the documentation in doc/godebug.md should mention that metrics are unavailable.
Conventionally, the global variable representing a godebug is named for the godebug itself, with no case changes:
var gotypesalias = godebug.New("gotypesalias") // this
var goTypesAlias = godebug.New("gotypesalias") // NOT THIS
The test in internal/godebugs that checks for use of IncNonDefault requires the use of this convention.
Note that counters used with IncNonDefault must be added to various tables in other packages. See the [Setting.IncNonDefault] documentation for details.
Copyright 2009 The Go Authors. All rights reserved. This C# package is converted from Go standard library source; use of that source is governed by a BSD-style license that can be found in the LICENSE file.
Artwork licensed under Creative Commons Attribution 3.0; see artwork attribution.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- go.internal.bisect (>= 1.24.13.2)
- go.internal.godebugs (>= 1.24.13.2)
- go.lib (>= 1.24.13.2)
- go.runtime (>= 1.24.13.2)
- go.sync (>= 1.24.13.2)
- go.sync.atomic (>= 1.24.13.2)
- go.unsafe (>= 1.24.13.2)
NuGet packages (23)
Showing the top 5 NuGet packages that depend on go.internal.godebug:
| Package | Downloads |
|---|---|
|
go.time
time (net10.0 - Release) -- C# project converted from Go source |
|
|
go.os
os (net10.0 - Release) -- C# project converted from Go source |
|
|
go.math.rand
math.rand (net10.0 - Release) -- C# project converted from Go source |
|
|
go.net
net (net10.0 - Release) -- C# project converted from Go source |
|
|
go.net.url
net.url (net10.0 - Release) -- C# project converted from Go source |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.24.13.2 | 529 | 9/24/2026 |
| 1.24.13.1 | 693 | 9/24/2026 |
| 1.23.12.3 | 1,554 | 9/8/2026 |
| 1.23.12.2 | 1,379 | 8/29/2026 |
| 1.23.12.1 | 1,483 | 8/26/2026 |
| 1.23.1.7 | 2,454 | 8/23/2026 |
| 1.23.1.6 | 2,039 | 8/11/2026 |
| 1.23.1.5 | 2,057 | 8/9/2026 |
| 1.23.1.4 | 2,016 | 8/8/2026 |
| 1.23.1.3 | 2,327 | 8/4/2026 |
| 1.23.1.2 | 2,436 | 7/27/2026 |
| 1.23.1.1 | 2,519 | 7/14/2026 |