diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go index f5829123716..fb5074e8140 100644 --- a/src/cmd/cgo/main.go +++ b/src/cmd/cgo/main.go @@ -15,6 +15,7 @@ import ( "flag" "fmt" "go/ast" + "go/printer" "go/token" "io" "os" @@ -158,6 +159,13 @@ func main() { os.Exit(2) } + if *godefs || *cdefs { + // Generating definitions pulled from header files, + // to be checked into Go repositories. + // Line numbers are just noise. + conf.Mode &^= printer.SourcePos + } + args := flag.Args() if len(args) < 1 { usage()