Closed
Description
When taking the example program from the README, and adding a /* single line comment */
like so:
package main
import "github.com/dave/dst/decorator"
func main() {
code := `/* single line comment */
package a
func main(){
var a int // foo
var b string // bar
}
`
f, err := decorator.Parse(code)
if err != nil {
panic(err)
}
if err := decorator.Print(f); err != nil {
panic(err)
}
}
…the output is:
/* single line comment */package a
func main() {
var a int // foo
var b string // bar
}
Note how package a
is now at the end of the previous line.
The same issue is reproducible with multi-line /* … */
comments.
I tested this with github.com/dave/dst v0.27.0, which is current at the time of writing.
Metadata
Metadata
Assignees
Labels
No labels