]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: don't print absolute path in comment
authorDavid Crawshaw <crawshaw@golang.org>
Mon, 19 Oct 2015 13:11:46 +0000 (09:11 -0400)
committerDavid Crawshaw <crawshaw@golang.org>
Mon, 19 Oct 2015 15:28:32 +0000 (15:28 +0000)
Change-Id: Ib424e14cfaab35d37ebdd084d41151928bfd645e
Reviewed-on: https://go-review.googlesource.com/16051
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>

src/cmd/cgo/godefs.go

index 1b0ece29ef4895d03aa3ca7d2eb3550c3e16d694..aff616ea5788408753d0ed4065bc07e401709c13 100644 (file)
@@ -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)