gpt4 book ai didi

go - golang 中的空函数

转载 作者:IT王子 更新时间:2023-10-29 02:16:06 25 4
gpt4 key购买 nike

<分区>

在看源码go的源码,下面是sleep.go的一个片段(打包时):

package time

// Sleep pauses the current goroutine for at least the duration d.
// A negative or zero duration causes Sleep to return immediately.
func Sleep(d Duration)
// runtimeNano returns the current value of the runtime clock in nanoseconds.
func runtimeNano() int64

func Sleep(d Duration) 怎么可能没有任何实现?在哪里可以找到 Sleep 函数的确切实现?

编辑:答案可以在@DaveC 提供的 2 个链接中找到。但是,请阅读下面的评论,了解为什么即使在引导 Go (1.5) 后空函数也不能用 Go 替换的解释

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