blob: 678a6727a97aea86612ea6810d4ed34da1c00baf [file] [log] [blame]
package source
import (
"go/parser"
"go/token"
"testing"
)
func TestTrimToImports(t *testing.T) {
const input = `package source
import (
m
"fmt"
)
func foo() {
fmt.Println("hi")
}
`
fs := token.NewFileSet()
f, _ := parser.ParseFile(fs, "foo.go", input, parser.ImportsOnly)
trimToImports(fs, f, []byte(input))
}