This:
package main
// comment
// comment
import "A"
// comment
type x a
// comment
var a int = 1
// comment
const a = iota
// comment
func a() {}
// comment
func (p *int) Length() {}should not be formatted at all. Instead it's formatted as:
package main
// comment
// comment
import "A"
// comment
type x a
// comment
var a int = 1
// comment
const a = iota
// comment
func a() {}
// comment
func (p *int) Length() {}