From: Russ Cox Date: Mon, 13 Feb 2012 21:02:13 +0000 (-0500) Subject: cmd/cgo: omit //line in -godefs, -cdefs output X-Git-Tag: weekly.2012-02-14~67 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=422826270de705ddb1c4982f4d544f46f7bdd55b;p=gostls13.git cmd/cgo: omit //line in -godefs, -cdefs output Makes files like src/pkg/syscall/ztypes_linux_amd64.go easier to read. (The copy that is checked in predates the //line output mode, so this also preserves the status quo.) R=golang-dev, iant, gri CC=golang-dev https://golang.org/cl/5655068 --- diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go index f582912371..fb5074e814 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()