go-tmbundle icon indicating copy to clipboard operation
go-tmbundle copied to clipboard

Function declarations (missing body) break highlighting for following code

Open mmcloughlin opened this issue 6 years ago • 1 comments

Illustrating with function highlighting in Github (which uses this package)

// A does not have a function body (implemented in assembly for example).
func A() int

// B is not highlighted correctly.
func B(a, b int) int { return a+b }

mmcloughlin avatar May 21 '18 18:05 mmcloughlin

The problem seems to be in some cases of functions signatures

type a func() (int, error)
type b func()
type c struct {}

It works when there is only one return value

type a func() int
type b func()

lamg avatar Jan 15 '19 19:01 lamg