]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: use standard generated code comment
authorIan Lance Taylor <iant@golang.org>
Tue, 29 May 2018 13:40:56 +0000 (06:40 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 29 May 2018 14:44:59 +0000 (14:44 +0000)
Change cgo to follow https://golang.org/s/generatedcode.

For the C code we continue to use /* */ comments, so they don't follow
the format exactly. It doesn't really matter since the format is only
for Go code anyhow. This CL changes the C code to be similar for
consistency.

Fixes #25623

Change-Id: Idcfee53ec4069924d173ab8cedeb7bcfb7312863
Reviewed-on: https://go-review.googlesource.com/115035
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
src/cmd/cgo/godefs.go
src/cmd/cgo/out.go

index 6d638f064422a726a84f3232aa53bc388eee9afe..6720945cdddbaf791a6b8df2ab2a9b62fa2177ba 100644 (file)
@@ -19,7 +19,7 @@ import (
 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, "// Code generated by cmd/cgo -godefs; DO NOT EDIT.\n")
        fmt.Fprintf(&buf, "// %s %s\n", filepath.Base(os.Args[0]), strings.Join(os.Args[1:], " "))
        fmt.Fprintf(&buf, "\n")
 
index 399e96d01e0e704aac6bc0374a988e53cc9e16ca..62ef872ca0da80cbba94c58916f0d0561512cf0e 100644 (file)
@@ -73,7 +73,7 @@ func (p *Package) writeDefs() {
        // Write second Go output: definitions of _C_xxx.
        // In a separate file so that the import of "unsafe" does not
        // pollute the original file.
-       fmt.Fprintf(fgo2, "// Created by cgo - DO NOT EDIT\n\n")
+       fmt.Fprintf(fgo2, "// Code generated by cmd/cgo; DO NOT EDIT.\n\n")
        fmt.Fprintf(fgo2, "package %s\n\n", p.PackageName)
        fmt.Fprintf(fgo2, "import \"unsafe\"\n\n")
        if !*gccgo && *importRuntimeCgo {
@@ -536,7 +536,7 @@ func (p *Package) writeOutput(f *File, srcfile string) {
        p.GccFiles = append(p.GccFiles, base+".cgo2.c")
 
        // Write Go output: Go input with rewrites of C.xxx to _C_xxx.
-       fmt.Fprintf(fgo1, "// Created by cgo - DO NOT EDIT\n\n")
+       fmt.Fprintf(fgo1, "// Code generated by cmd/cgo; DO NOT EDIT.\n\n")
        fmt.Fprintf(fgo1, "//line %s:1\n", srcfile)
        fgo1.Write(f.Edit.Bytes())
 
@@ -740,7 +740,7 @@ func (p *Package) packedAttribute() string {
 func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) {
        p.writeExportHeader(fgcch)
 
-       fmt.Fprintf(fgcc, "/* Created by cgo - DO NOT EDIT. */\n")
+       fmt.Fprintf(fgcc, "/* Code generated by cmd/cgo; DO NOT EDIT. */\n\n")
        fmt.Fprintf(fgcc, "#include <stdlib.h>\n")
        fmt.Fprintf(fgcc, "#include \"_cgo_export.h\"\n\n")
 
@@ -981,7 +981,7 @@ func (p *Package) writeGccgoExports(fgo2, fm, fgcc, fgcch io.Writer) {
 
        p.writeExportHeader(fgcch)
 
-       fmt.Fprintf(fgcc, "/* Created by cgo - DO NOT EDIT. */\n")
+       fmt.Fprintf(fgcc, "/* Code generated by cmd/cgo; DO NOT EDIT. */\n\n")
        fmt.Fprintf(fgcc, "#include \"_cgo_export.h\"\n")
 
        fmt.Fprintf(fgcc, "%s\n", gccgoExportFileProlog)
@@ -1147,7 +1147,7 @@ func (p *Package) writeGccgoExports(fgo2, fm, fgcc, fgcch io.Writer) {
 
 // writeExportHeader writes out the start of the _cgo_export.h file.
 func (p *Package) writeExportHeader(fgcch io.Writer) {
-       fmt.Fprintf(fgcch, "/* Created by \"go tool cgo\" - DO NOT EDIT. */\n\n")
+       fmt.Fprintf(fgcch, "/* Code generated by cmd/cgo; DO NOT EDIT. */\n\n")
        pkg := *importPath
        if pkg == "" {
                pkg = p.PackagePath