Home » Core Golang » Convert Integer to String in Golang

Convert Integer to String in Golang

To convert an int value to string in Golang we can use the strconv package’s Itoa function.

It is interesting to note that strconv.Itoa is shorthand for with base 10

func FormatInt(i int64, base int) string

For Example:


is equivalent to

strconv.FormatInt(int64(123), 10)

Below you can find whole example:

package main

import (

func main() {
	t := strconv.Itoa(123)

	formatInt := strconv.FormatInt(int64(123), 10)


Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top