Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cgo: avoid extra newline in doc comment of exported function #37723

Closed
wants to merge 1 commit into from

Conversation

@nathan-fiscaletti
Copy link
Contributor

nathan-fiscaletti commented Mar 6, 2020

Fixes #37722

@googlebot

This comment has been minimized.

Copy link

googlebot commented Mar 6, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no label Mar 6, 2020
@nathan-fiscaletti nathan-fiscaletti changed the title Fixes https://github.com/golang/go/issues/37722 Fixes an issue with CGO exported functions documentation adding an unnecessary new line Mar 6, 2020
@nathan-fiscaletti

This comment has been minimized.

Copy link
Contributor Author

nathan-fiscaletti commented Mar 6, 2020

@googlebot I signed it!

@googlebot

This comment has been minimized.

Copy link

googlebot commented Mar 6, 2020

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Mar 6, 2020
@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 6, 2020

This PR (HEAD: 962a5c4) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/222419 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 6, 2020

Message from Gobot Gobot:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
Within the next week or so, a maintainer will review your change and provide
feedback. See https://golang.org/doc/contribute.html#review for more info and
tips to get your patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11, it means that this CL will be reviewed as part of the next development
cycle. See https://golang.org/s/release for more details.


Please don’t reply on this GitHub thread. Visit golang.org/cl/222419.
After addressing review feedback, remember to publish your drafts!

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 6, 2020

Message from Ian Lance Taylor:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/222419.
After addressing review feedback, remember to publish your drafts!

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
@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 6, 2020

This PR (HEAD: 9fbe1c1) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/222419 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 6, 2020

Message from Nathan Fiscaletti:

Patch Set 2:

(1 comment)

I've updated the commit message 👍


Please don’t reply on this GitHub thread. Visit golang.org/cl/222419.
After addressing review feedback, remember to publish your drafts!

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 7, 2020

Message from Ian Lance Taylor:

Patch Set 2:

When using GitHub you need to update the commit message by editing the GitHub pull request. See the bottom of https://golang.org/wiki/CommitMessage. Thanks.


Please don’t reply on this GitHub thread. Visit golang.org/cl/222419.
After addressing review feedback, remember to publish your drafts!

@nathan-fiscaletti nathan-fiscaletti changed the title Fixes an issue with CGO exported functions documentation adding an unnecessary new line cmd/cgo: removes new line for exported functions Mar 7, 2020
@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 7, 2020

Message from Nathan Fiscaletti:

Patch Set 4:

(1 comment)

Hopefully that fixes the issue. Sorry, first time contributor through this toolchain.


Please don’t reply on this GitHub thread. Visit golang.org/cl/222419.
After addressing review feedback, remember to publish your drafts!

@nathan-fiscaletti nathan-fiscaletti changed the title cmd/cgo: removes new line for exported functions cmd/cgo: avoid extra newline in doc comment of exported function Mar 7, 2020
@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 7, 2020

Message from Nathan Fiscaletti:

Patch Set 5:

Additionally I'm wondering if i should change it to:

if len(exp.Doc) > 0 {
fmt.Fprintf(fgcch, "\n%s", exp.Doc)
// Only add a new line at the end of the documentation
// if one does not already exist
if !strings.HasSuffix(exp.Doc, "\n") {
fmt.Fprint(fgcch, "\n")
}
} else {
// Add a new line to separate the function exports
// when no documenation is provided
fmt.Fprint(fgcch, "\n")
}
fmt.Fprintf(fgcch, "extern %s;\n", s)

In order to maintain the separation of function exports even when they do not have any documentation.


Please don’t reply on this GitHub thread. Visit golang.org/cl/222419.
After addressing review feedback, remember to publish your drafts!

@sdadas11

This comment has been minimized.

Copy link

sdadas11 commented Mar 7, 2020

orz

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 7, 2020

Message from Ian Lance Taylor:

Patch Set 5:

(1 comment)

Additionally I'm wondering if i should change it to:

if len(exp.Doc) > 0 {
fmt.Fprintf(fgcch, "\n%s", exp.Doc)
// Only add a new line at the end of the documentation
// if one does not already exist
if !strings.HasSuffix(exp.Doc, "\n") {
fmt.Fprint(fgcch, "\n")
}
} else {
// Add a new line to separate the function exports
// when no documenation is provided
fmt.Fprint(fgcch, "\n")
}
fmt.Fprintf(fgcch, "extern %s;\n", s)

In order to maintain the separation of function exports even when they do not have any documentation.

I wouldn't worry about it. C header files often have function declarations with no intervening blank lines.


Please don’t reply on this GitHub thread. Visit golang.org/cl/222419.
After addressing review feedback, remember to publish your drafts!

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 7, 2020

Message from Nathan Fiscaletti:

Patch Set 6:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/222419.
After addressing review feedback, remember to publish your drafts!

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 7, 2020

Message from Emmanuel Odeke:

Patch Set 6: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/222419.
After addressing review feedback, remember to publish your drafts!

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 7, 2020

Message from Gobot Gobot:

Patch Set 6:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=c3ca3642


Please don’t reply on this GitHub thread. Visit golang.org/cl/222419.
After addressing review feedback, remember to publish your drafts!

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 7, 2020

Message from Gobot Gobot:

Patch Set 6: TryBot-Result+1

TryBots are happy.


Please don’t reply on this GitHub thread. Visit golang.org/cl/222419.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Mar 7, 2020
Fixes #37722

Change-Id: Ie9154f9d91824558a8ac34ad2fb5bc4e02c64a4b
GitHub-Last-Rev: 9fbe1c1
GitHub-Pull-Request: #37723
Reviewed-on: https://go-review.googlesource.com/c/go/+/222419
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 7, 2020

Message from Ian Lance Taylor:

Patch Set 6: Code-Review+2

Thanks.


Please don’t reply on this GitHub thread. Visit golang.org/cl/222419.
After addressing review feedback, remember to publish your drafts!

@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Mar 7, 2020

This PR is being closed because golang.org/cl/222419 has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.