motion icon indicating copy to clipboard operation
motion copied to clipboard

Panics for functions without body closures

Open fatih opened this issue 6 years ago • 2 comments

This panics:

package main

func foo(bar string)

func main() {}

This is valid AST, but not valid go program. Can easily happen during refactor or if we write new code.

fatih avatar Mar 05 '18 10:03 fatih

A function declaration without a body is valid Go. Such a declaration provides the signature for a function implemented outside Go, such as an assembly routine.

ghost avatar Mar 05 '18 16:03 ghost

Oh, that's indeed totally true! Thanks for the reminder @claudia-jones. In any case, we need to fix this.

fatih avatar Mar 05 '18 16:03 fatih