Skip to content

Instantly share code, notes, and snippets.

@irshadhasmat
Created May 29, 2018 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save irshadhasmat/5c163bd4237ff9021a711a62c02814e4 to your computer and use it in GitHub Desktop.
Save irshadhasmat/5c163bd4237ff9021a711a62c02814e4 to your computer and use it in GitHub Desktop.
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