Skip to content
masterclass Buddy

Go · Function

strconv.Atoi

strconv.Atoi converts a decimal string to an int. It returns the converted value and an error.

Last updated

Syntax

func Atoi(s string) (int, error)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • strconv.ParseInt
  • strconv.Itoa
  • strconv.NumError
  • strconv.ErrRange
  • strconv.ErrSyntax

Source: strconv package - strconv - Go Packages. Checked 2026-11-03.