godebug

package
v0.0.0-...-52ea55a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 0 Imported by: 0

README

Package godebug is Go 1.21.3's internal/godebug package, except that all settings always return "".

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Setting

type Setting struct {
	// contains filtered or unexported fields
}

A Setting is a single setting in the $GODEBUG environment variable.

func New

func New(name string) *Setting

New returns a new Setting for the $GODEBUG setting with the given name.

func (*Setting) IncNonDefault

func (s *Setting) IncNonDefault()

IncNonDefault increments the non-default behavior counter associated with the given setting. This counter is exposed in the runtime/metrics value /godebug/non-default-behavior/<name>:events.

Note that Value must be called at least once before IncNonDefault.

func (*Setting) Name

func (s *Setting) Name() string

Name returns the name of the setting.

func (*Setting) String

func (s *Setting) String() string

String returns a printable form for the setting: name=value.

func (*Setting) Value

func (s *Setting) Value() string

Value returns the current value for the GODEBUG setting s.

Value maintains an internal cache that is synchronized with changes to the $GODEBUG environment variable, making Value efficient to call as frequently as needed. Clients should therefore typically not attempt their own caching of Value's result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL