我有这样的并发例程,
Routine 1()
{
for 30 times
Send string
}
Routine 2 (out <-chan string)
{
for
case str := <- out:
fmt.Println(str)
}
Run Code Online (Sandbox Code Playgroud)
现在,我想从例程1字符串发送,如string + int + string +系统时间,以纳秒为单位.任何人都可以帮助我如何实现这一目标.
对不起,我太早问了.有可能这样:
out <- string + strconv.Itoa(int) + string + strconv.Itoa64(time.Nanoseconds())
Run Code Online (Sandbox Code Playgroud)
谢谢.
更新(Go1):strconv.Itoa64已被替换为strconv.FormatInt.
| 归档时间: |
|
| 查看次数: |
4633 次 |
| 最近记录: |