strconv.Itoa64(1234)在golang中给出了undefined

Yst*_*ter 21 go int64 uint64

这是我的代码:

package main
import (
    "strconv"
    "fmt"
)
func main() {
    t := strconv.Itoa64(1234)
    fmt.Println(t)
}
Run Code Online (Sandbox Code Playgroud)

问题:

为什么会导致以下错误消息?

命令行参数.\ test.go:7:undefined:strconv.Itoa64 [以0.2秒结束,退出代码为2]

Ste*_*erg 59

这是因为Itoa64不是strconv包中函数的名称.看起来你真的很想要.

t := strconv.FormatInt(1234, 10)
Run Code Online (Sandbox Code Playgroud)

请参阅http://golang.org/pkg/strconv/#FormatInt

  • 在str 1之前存在`strconv.Itoa64`.这就是存在冲突信息的原因. (11认同)