Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

strconv.Itoa64(1234) gives undefined in golang

Tags:

go

int64

uint64

This is my code:

package main
import (
    "strconv"
    "fmt"
)
func main() {
    t := strconv.Itoa64(1234)
    fmt.Println(t)
}

Problem:

Why does it cause the following error message?

command-line-arguments .\test.go:7: undefined: strconv.Itoa64 [Finished in 0.2s with exit code 2]

like image 955
Yster Avatar asked Aug 31 '12 17:08

Yster


1 Answers

This is because Itoa64 is not the name of a function in the strconv package. It looks like you really want.

t := strconv.FormatInt(1234, 10)

See http://golang.org/pkg/strconv/#FormatInt

like image 56
Stephen Weinberg Avatar answered Sep 23 '22 02:09

Stephen Weinberg