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

Change generated header comment according Go standard #1338

Closed
wants to merge 1 commit into from
Closed

Change generated header comment according Go standard #1338

wants to merge 1 commit into from

Conversation

alexandear
Copy link
Contributor

@alexandear alexandear commented Feb 2, 2023

Summary

This PR changes generated header comment to conform Go standard's regexp: ^// Code generated .* DO NOT EDIT\.$.

Changes

  • Edit headerTemplate in _codegen/main.go.
  • Run go generate ./....

Motivation

In Go, we have the standard comment line that marks machine-generated files. From the official documentation:

To convey to humans and machine tools that code is generated, generated source should have a line that matches the following regular expression (in Go syntax):

^// Code generated .* DO NOT EDIT\.$

See the discussion and final agreement.

@dolmen
Copy link
Collaborator

dolmen commented Jul 6, 2023

Thank you for this patch. It appears I had independently written a similar patch. Your PR did not mention "codegen" so I missed it.

I'll push to mine being merged as I also mentioned references to the permalink that links to the standard.

@dolmen dolmen closed this Jul 6, 2023
@alexandear alexandear deleted the change-code-generated-comment branch July 6, 2023 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants