Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

// comments instead of /* .. */ #16

Closed
drnic opened this issue Apr 26, 2014 · 11 comments
Closed

// comments instead of /* .. */ #16

drnic opened this issue Apr 26, 2014 · 11 comments

Comments

@drnic
Copy link
Contributor

drnic commented Apr 26, 2014

It seems more common for Go programs/libraries (esp samples shown at gophercon this week) use single line // comments rather than multiline /* ... */ comments. Can we change?

@joefitzgerald
Copy link
Contributor

👍 Where's the PR @drnic?

@drnic
Copy link
Contributor Author

drnic commented Apr 26, 2014

Want to know if it's ok or if authors have some overriding preference.

On Sat, Apr 26, 2014 at 2:35 PM, Joe Fitzgerald notifications@github.com
wrote:

👍 Where's the PR @drnic?

Reply to this email directly or view it on GitHub:
#16 (comment)

@nathansobo
Copy link
Contributor

I'm fine trusting interested Go users on this one.

@joefitzgerald
Copy link
Contributor

@drnic Pull request to 🚀 please – this is bugging me also.

@joefitzgerald
Copy link
Contributor

Further references supporting the desire to prefer // over /* ... */:

In summary, it the vast majority of your comments are likely to be line-style. Block-style comments may occasionally be seen in package comments, but even then only in non-trivial packages (likely with examples).

Consequently, // would be preferable as it is most commonly used, and it would be nice if we had another keyboard shortcut for /* ... */?

@drnic
Copy link
Contributor Author

drnic commented Apr 28, 2014

@nathansobo I'm looking across a couple of packages - not sure what it is that defines the comment type for Cmd+/ - can you point me to some examples?

@joefitzgerald
Copy link
Contributor

@joefitzgerald
Copy link
Contributor

@drnic
Copy link
Contributor Author

drnic commented Apr 28, 2014

I think that's just defining that /* ... */ is a valid multi-level comment
syntax. Not that Cmd+/ toggles comment.

On Mon, Apr 28, 2014 at 9:50 AM, Joe Fitzgerald notifications@github.comwrote:

@drnic https://github.com/drnic @nathansobohttps://github.com/nathansobo
https://github.com/atom/language-go/blob/master/grammars/go.cson#L300-L324
?


Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-41582914
.

Dr Nic Williams
Stark & Wayne LLC - consultancy for Cloud Foundry users
http://drnicwilliams.com
http://starkandwayne.com
cell +1 (415) 860-2185
twitter @drnic

@joefitzgerald
Copy link
Contributor

When you comment the editor wraps the text in <span class="comment block go">...</>. https://github.com/atom/language-go/blob/master/grammars/go.cson#L15 Defines comment.block.empty.go. https://github.com/atom/language-go/blob/master/grammars/go.cson#L308 defines comment.block.go.

@joefitzgerald
Copy link
Contributor

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

No branches or pull requests

3 participants