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

Consider moving generated file comment to satisfy golint #7

Open
montanaflynn opened this issue Apr 20, 2020 · 3 comments
Open

Consider moving generated file comment to satisfy golint #7

montanaflynn opened this issue Apr 20, 2020 · 3 comments

Comments

@montanaflynn
Copy link

Because the current comment is put at the top it causes golint to complain:

domains.gen.go:1:1: package comment should be of the form "Package swot ..."
// Code generated by broccoli at 2020-04-20T23:26:30+07:00.
package swot

import "aletheia.icu/broccoli/fs"

var br = fs.New("...")

Screen Shot 2020-04-20 at 22 57 35

I suggest moving it to above the variable:

package swot

import "aletheia.icu/broccoli/fs"

// Code generated by broccoli at 2020-04-20T23:26:30+07:00.
var br = fs.New("...")
@jonlundy
Copy link

jonlundy commented Apr 23, 2020

The comment should have DO NOT EDIT. and an extra blank line following. That will indicate to linters that the file is auto generated and will exclude it from linting.

See https://golang.org/s/generatedcode

EXAMPLE

// Code generated by broccoli at 2020-04-20T23:26:30+07:00. DO NOT EDIT.

package swot

import "aletheia.icu/broccoli/fs"

var br = fs.New("...")

@montanaflynn
Copy link
Author

Ahh TIL, that sounds good!

@montanaflynn
Copy link
Author

Changing the comment to:

// Code generated by broccoli at 2020-04-20T23:26:30+07:00. DO NOT EDIT.

Even without an extra blank line removed the warning and signaled it was a generated file.

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