Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GoLang : Int & Int64 to String Conversion
package main
import (
"fmt"
"strconv"
)
func main() {
var i int = 12345
var i64 int64 = 12345
// Conversion of Int to String
strInt := strconv.Itoa(i)
fmt.Println(strInt)
// Conversion of Int64 to String
strInt64 := strconv.FormatInt(i64, 10)
fmt.Println(strInt64)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment