go - Empty function in golang -


this question has answer here:

was looking @ source code go source code, below snippet sleep.go (package time):

package time  // sleep pauses current goroutine @ least duration d. // negative or 0 duration causes sleep return immediately. func sleep(d duration)  // runtimenano returns current value of runtime clock in nanoseconds. func runtimenano() int64 

how possible func sleep(d duration) doesn't have implementation? can find exact implementation of sleep function?

edit: answer can found in 2 links provided @davec. please read comments below see explanation why empty function can't replaced go after bootstrapping go (1.5)

considering sleep() (it deschedules golang thread given amount of time), can't express in go, it's implemented kind of compiler instrinsic.

whoa, lots of downvotes here. looks sleep in fact implemented in assembly.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -