mirror of
https://github.com/golang/go
synced 2024-11-17 15:44:40 -07:00
cmd/cgo: removes new line for exported functions
removes an unnecessary new line that was being added between a cgo exported function and it's documentation block in the generated header file when the documentation block already ended with a new line Fixes #37722
This commit is contained in:
parent
1d90e1a0ac
commit
9fbe1c1d80
@ -921,8 +921,11 @@ func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) {
|
|||||||
|
|
||||||
if len(exp.Doc) > 0 {
|
if len(exp.Doc) > 0 {
|
||||||
fmt.Fprintf(fgcch, "\n%s", exp.Doc)
|
fmt.Fprintf(fgcch, "\n%s", exp.Doc)
|
||||||
|
if !strings.HasSuffix(exp.Doc, "\n") {
|
||||||
|
fmt.Fprint(fgcch, "\n")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fmt.Fprintf(fgcch, "\nextern %s;\n", s)
|
fmt.Fprintf(fgcch, "extern %s;\n", s)
|
||||||
|
|
||||||
fmt.Fprintf(fgcc, "extern void _cgoexp%s_%s(void *, int, __SIZE_TYPE__);\n", cPrefix, exp.ExpName)
|
fmt.Fprintf(fgcc, "extern void _cgoexp%s_%s(void *, int, __SIZE_TYPE__);\n", cPrefix, exp.ExpName)
|
||||||
fmt.Fprintf(fgcc, "\nCGO_NO_SANITIZE_THREAD")
|
fmt.Fprintf(fgcc, "\nCGO_NO_SANITIZE_THREAD")
|
||||||
|
Loading…
Reference in New Issue
Block a user