Empty function declarations
August 23, 2023
Function declarations
…
A function declaration without type parameters may omit the body. Such a declaration provides the signature for a function implemented outside Go, such as an assembly routine.
func flushICache(begin, end uintptr) // implemented externally
This is something I have never used. Most developers probably never will. Although I’ve certainly seen it a few times, particularly while browsing the standard library source code, so it’s good to be aware of it, so you aren’t stuck scratching your head when you see it.
If you have ever used this feature yourself, would you let me know? I’m curious how common it is.
Quotes from The Go Programming Language Specification Version of August 2, 2023