Golang : convert(cast) string to integer value

To convert or cast a string to integer value, just use the strconv.Atoi() function. Below is the code example to demonstrate how to convert string to integer value.

 package main

 import (

 func main() {
 var i int

 i, _ = strconv.Atoi("123")


By Adam Ng

IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.