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

bad formatting for inline comment for return value #29

Open
andreimatei opened this issue Dec 28, 2018 · 1 comment
Open

bad formatting for inline comment for return value #29

andreimatei opened this issue Dec 28, 2018 · 1 comment
Assignees

Comments

@andreimatei
Copy link
Contributor

I want this:

func (r *limitedCommandResult) AddRow(
  ctx context.Context, row tree.Datums,
) (_ /* cont */ bool, _ error) {

the tool gives me this:

func (r *limitedCommandResult) AddRow(
	ctx context.Context, row tree.Datums,
) (
	_ bool, /* cont */
	_ error,
) {
@benesch
Copy link
Contributor

benesch commented Jan 2, 2019

Yes, that's by design. If you want to document a result parameter with an inline comment then it deserves its own line IMO. Also, in this case I'd just name the result parameter:

func (r *limitedCommandResult) AddRow(
  ctx context.Context, row tree.Datums,
) (cont bool, _ error)

Since you're the biggest proponent of comments in result params I'm happy to defer to your style preferences though. But since I won't have time to fix this I'm punting the assignment back to you. The code you'd have to change is around here:

if results != nil {
for _, r := range results.List {
if r.Doc != nil || r.Comment != nil {
resultsHaveComments = true
break
}
}
}

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

No branches or pull requests

2 participants