Documentation ¶
Overview ¶
Package stringconv provides functions for string conversions to various number types. It simplifies the conversion (casting) between strings and various numeric types in Go, such as int, int64, uint, etc., in a secure manner that gracefully handles type overflows.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToWholeNumber ¶
func ToWholeNumber[T WholeNumber](str string) (T, error)
ToWholeNumber safely converts a string to a given whole number type (e.g., int, uint) with positive or negative handling. It returns the converted number and an error if the conversion fails.
Types ¶
Click to show internal directories.
Click to hide internal directories.