From: David Crawshaw Date: Mon, 19 Oct 2015 13:11:46 +0000 (-0400) Subject: cmd/cgo: don't print absolute path in comment X-Git-Tag: go1.6beta1~808 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e920f7d5c5becbc013908dd6b16fc3d7d1d996c4;p=gostls13.git cmd/cgo: don't print absolute path in comment Change-Id: Ib424e14cfaab35d37ebdd084d41151928bfd645e Reviewed-on: https://go-review.googlesource.com/16051 Reviewed-by: Brad Fitzpatrick Run-TryBot: David Crawshaw --- diff --git a/src/cmd/cgo/godefs.go b/src/cmd/cgo/godefs.go index 1b0ece29ef..aff616ea57 100644 --- a/src/cmd/cgo/godefs.go +++ b/src/cmd/cgo/godefs.go @@ -11,6 +11,7 @@ import ( "go/printer" "go/token" "os" + "path/filepath" "strings" ) @@ -19,7 +20,7 @@ func (p *Package) godefs(f *File, srcfile string) string { var buf bytes.Buffer fmt.Fprintf(&buf, "// Created by cgo -godefs - DO NOT EDIT\n") - fmt.Fprintf(&buf, "// %s\n", strings.Join(os.Args, " ")) + fmt.Fprintf(&buf, "// %s %s\n", filepath.Base(os.Args[0]), strings.Join(os.Args[1:], " ")) fmt.Fprintf(&buf, "\n") override := make(map[string]string)