gpt4 book ai didi

go - strconv.Itoa(time.Nanoseconds()) - 错误

转载 作者:IT王子 更新时间:2023-10-29 01:34:17 25 4
gpt4 key购买 nike

我写了这样的一次性代码,strconv.Itoa(time.Nanoseconds())。但是,它给我这个错误“不能使用 time.Nanoseconds()(类型 int64)作为函数参数中的类型 int”。我该如何解决这个问题?

最佳答案

例如,

package main

import (
"fmt"
"strconv"
"time"
)

func main() {
t := strconv.FormatInt(time.Nanoseconds(), 10)
fmt.Println(t)
}

输出:

1322756865962046000

关于go - strconv.Itoa(time.Nanoseconds()) - 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8344210/

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