$ cat x.go
package p // comment
import "math"
var _ = fmt.Printf
$ goimports x.go
package p // comment
import "fmt"
var _ = fmt.Printf
$
The blank line should not have been removed. This only happens when there is an end-of-line comment on the package statement.
/cc @bradfitz