strconv

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseInteger

func ParseInteger[T Integer](s string, base int) (res T, err error)

ParseInteger parses a string s in the given base and returns a value of type T. T must be an integer type (signed or unsigned). The base argument must be between 2 and 36, or be 0.

Inspired by discussion in issue https://github.com/golang/go/issues/76223.

Types

type Integer

type Integer interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

Jump to

Keyboard shortcuts

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