gpt4 book ai didi

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

转载 作者:IT老高 更新时间:2023-10-28 13:02:50 27 4
gpt4 key购买 nike

这是我的代码:

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

问题:

为什么会出现以下错误信息?

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

最佳答案

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

t := strconv.FormatInt(1234, 10)

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

关于go - strconv.Itoa64(1234) 在 golang 中给出 undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12219911/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com