Go's parser can be used on code with any formatting.
It seems like that approach that would be fraught with errors considering how lenient gofmt can be at times but maybe it would be okay for simple stuff. e.g all of these ways of invoking methods:
fmt.
Println("Hello ",
"World",
)
fmt.Println("Hello ",
"World")
fmt.Println("Hello ", "World")