From: Ian Lance Taylor Date: Wed, 4 Nov 2015 01:18:42 +0000 (-0800) Subject: cmd/cgo: add a missing newline in writeExports X-Git-Tag: go1.6beta1~640 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2780abd645536db2f23d6c1f47bb404bc1da8fea;p=gostls13.git cmd/cgo: add a missing newline in writeExports The code works without the newline, but it looks funny: func _cgoexp_15afe6549f62_GoFn(a unsafe.Pointer, n int32) { fn := GoFn This adds a newline after the '{'. Change-Id: I6c465abe16f47924426d1b22b91004b3a3586ebd Reviewed-on: https://go-review.googlesource.com/16612 Run-TryBot: Ian Lance Taylor Reviewed-by: Minux Ma TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go index b69f410d15..86184e5df4 100644 --- a/src/cmd/cgo/out.go +++ b/src/cmd/cgo/out.go @@ -814,7 +814,7 @@ func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) { fmt.Fprintf(fgo2, "//go:cgo_export_static _cgoexp%s_%s\n", cPrefix, exp.ExpName) fmt.Fprintf(fgo2, "//go:nosplit\n") // no split stack, so no use of m or g fmt.Fprintf(fgo2, "//go:norace\n") // must not have race detector calls inserted - fmt.Fprintf(fgo2, "func _cgoexp%s_%s(a unsafe.Pointer, n int32) {", cPrefix, exp.ExpName) + fmt.Fprintf(fgo2, "func _cgoexp%s_%s(a unsafe.Pointer, n int32) {\n", cPrefix, exp.ExpName) fmt.Fprintf(fgo2, "\tfn := %s\n", goname) // The indirect here is converting from a Go function pointer to a C function pointer. fmt.Fprintf(fgo2, "\t_cgo_runtime_cgocallback(**(**unsafe.Pointer)(unsafe.Pointer(&fn)), a, uintptr(n));\n")