这是我的代码:
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