Skip to content

Refactoring #31

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

Merged
merged 16 commits into from
Nov 6, 2024
Merged

Refactoring #31

merged 16 commits into from
Nov 6, 2024

Conversation

plar
Copy link
Owner

@plar plar commented Nov 6, 2024

In this PR, I've implemented several long-desired refactorings:

Build and Continuous Integration

  • Replaced the Makefile with a bash make script. The previous targets were all PHONY, and the Makefile syntax wasn't ideal.
  • Added GitHub Actions for continuous integration and automation.

Go Environment and Tools

  • Integrated Go ecosystem tools for quality assurance, including mod, fmt, vet, lint, staticcheck, vulncheck, and gogec.
  • Updated go.mod to Go version 1.18.
  • Updated Go dependencies.

Code Refactoring

  • Simplified node structures and merged the zeroChild field into the children field.
  • Simplified code by eliminating bit operations for certain nodes.
  • Merged similar functionality between the ForEach method and the Iterator.
  • Split node.go and tree.go into separate files for improved modularity.
  • Refactored and simplified tree iteration and traversal functionality.
  • Refactored and simplified the String method for the tree.

Testing and Quality Assurance

  • Introduced golden files for tests.
  • Added t.Parallel for running tests in parallel.
  • Refactored some tests for better coverage and readability.

Code Quality

  • Fixed numerous Go lint warnings.
  • Added comments to internal code for clarity.
  • Renamed variables and method names to improve readability. (After all, cache invalidation and naming things are the two hard things in computer science. :)

This refactoring effort enhances code structure and quality without altering the external interface/public API.

@plar plar self-assigned this Nov 6, 2024
@plar plar merged commit 0270c76 into master Nov 6, 2024
4 checks passed
@plar plar deleted the refactoring branch November 6, 2024 09:40
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.

1 participant