GO: Convert Integer to String

Learn how to convert an integer to a string using Go

GO: Convert Integer to String

We use the Itoa function from the strconv package to convert an integer to a string.

// Create an integer. 
number := 2525

// Convert integer to string.
numberStr := strconv.Itoa(number)

// Print type and value.
fmt.Printf("Type: %T, Value: %s\n", number, numberStr)

Output:

Type: string, Value: 2525