strconv.Itoa
strconv.Atoi
strconv.ParseFloat
10進数の文字列を整数に変換します。
strconv.Atoi(s string) (int, error)
아래 값을 입력하면 예제에 즉시 반영됩니다.
err
strconv
Atoi
if
nil
fmt
Println
n, err := strconv.Atoi("42") if err == nil { fmt.Println(n + 1) // 43 }