Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

grantnelson-wf
Copy link
Collaborator

@grantnelson-wf grantnelson-wf commented Sep 9, 2025

GopherJS is such a long lived project that there are many places that don't follow modern Go policies, therefore we've been fairly relaxed about policies overall. They are more what you call "guidelines" than actual rules.

This PR is simply to correct some of the code that doesn't align with Go's recommendations, such as found in Effective Go. This PR contains:

  1. Updated from interface{} to any
  2. Grouped imports
  3. Fixed some of the comments to follow the Go recommendation of having the first word in the comment be the identifier the comment is on. I left the comments as they were for natives and code borrowed from Go (e.g. SSA code)
  4. Change package names to lowercase to match Package Names
    • I had some problems with case insensitive paths so I renamed the packages
    • I also moved some code into incjs that should have been part of that package
  5. Reduce stuttering, e.g. jsfile.JSFile => incjs.File
  6. Ran gofmt. Found a comment that needed a blank comment line before the directive
  7. I broke up some overly long single lines of code
  8. Checked that error messages follow the standards of not starting with a capital letter and not ending with peculation. None did except in code borrowed from Go or where the first word is "GopherJS" or an exported method name

There are probably a lot more fixes that I could do, but I didn't want this PR to get too long so I kept to the most noticeable issues (i.e. issues that stuck out first to me).

@grantnelson-wf grantnelson-wf marked this pull request as ready for review September 12, 2025 17:59
@grantnelson-wf grantnelson-wf changed the title [WIP] Update to align with policies Update to align with policies Sep 12, 2025
Copy link
Member

@flimzy flimzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@grantnelson-wf grantnelson-wf merged commit f3e2f1d into gopherjs:master Sep 12, 2025
10 checks passed
@grantnelson-wf grantnelson-wf deleted the policyAlign1 branch September 12, 2025 18:58
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

Successfully merging this pull request may close these issues.

2 participants