This question is about Go’s automatic semicolon insertion.
The error message indicated Go knows that func f() will followed by a {, so obviously ; shouldn’t be inserted at the end of func f()unless it can be a statement itself.
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.
No, the FAQ states that Go inserts a semicolon if the end of the line could be the end a complete statement. The end of func f() cannot be the end of a complete statement by any definition, so Go does not insert a semicolon and errors out instead.
go tool compile -S <gofile.go> creates assembler from the gofile.go
To implement a function in assembler, it’s enough to have the implementation in asm_amd64.s (name depends on platform) in the directory where you call go build .