go.internal.godebug 1.23.1.3

dotnet add package go.internal.godebug --version 1.23.1.3
                    
NuGet\Install-Package go.internal.godebug -Version 1.23.1.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="go.internal.godebug" Version="1.23.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="go.internal.godebug" Version="1.23.1.3" />
                    
Directory.Packages.props
<PackageReference Include="go.internal.godebug" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add go.internal.godebug --version 1.23.1.3
                    
#r "nuget: go.internal.godebug, 1.23.1.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package go.internal.godebug@1.23.1.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=go.internal.godebug&version=1.23.1.3
                    
Install as a Cake Addin
#tool nuget:?package=go.internal.godebug&version=1.23.1.3
                    
Install as a Cake Tool

go.internal.godebug

C# package converted from the Go standard library by go2cs. Go version: 1.23.1

Tests

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.


Part of the go2cs converted Go standard library. See the repository for usage and 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. The go2cs conversion itself is distributed under the MIT license.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (18)

Showing the top 5 NuGet packages that depend on go.internal.godebug:

Package Downloads
go.time

time (net9.0 - Release) -- C# project converted from Go source

go.os

os (net9.0 - Release) -- C# project converted from Go source

go.math.rand

math.rand (net9.0 - Release) -- C# project converted from Go source

go.net

net (net9.0 - Release) -- C# project converted from Go source

go.crypto.x509

crypto.x509 (net9.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.23.1.3 350 8/4/2026
1.23.1.2 2,244 7/27/2026
1.23.1.1 2,354 7/14/2026