Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

golint thinks "/*" contains a trailing space #22

Closed
dgryski opened this issue Sep 3, 2013 · 2 comments
Closed

golint thinks "/*" contains a trailing space #22

dgryski opened this issue Sep 3, 2013 · 2 comments

Comments

@dgryski
Copy link

dgryski commented Sep 3, 2013

Running golint over code like:

/* Package foo does some stuff

Extra notes about foo that I want in the godoc
*/
package foo

generates the warning:

 package comment should not have leading space

Changing it to

/*Package foo ...

"solves" the problem but looks ugly.

Another workaround is to use

// Package foo does some stufff
/* Extra notes about foo I want in the godoc
*/
package foo

but neither of these are suggested. Perhaps a better comment or check should be "Package comment should start with //"

@aclissold
Copy link

I was going to suggest simply writing

/*
Package foo does some stuff

Extra notes about foo that I want in the godoc
*/

as that avoids the problem (and isn't ugly in my opinion), but trying it out on an example in the Go source actually causes the same "leading space" error to occur because they indented it. Interesting!

@dsymonds
Copy link
Contributor

dsymonds commented Sep 3, 2013

The form that ajclisso posted is the standard style for package and doc comments using /* */. testdata/pkg-doc3.go in this repository checks for that.

The standard library is not perfect, and that's okay.

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