Skip to content

v0.9.2-alpha

Pre-release
Pre-release

Choose a tag to compare

@sheymor21 sheymor21 released this 17 Jul 18:39
· 3 commits to main since this release

πŸ”§ Refactor: Remove utilities package by inlining its logic and adjust references across the project

Breaking Changes:

  • Removed the entire utilities package
  • All utility functions have been inlined into their respective usage locations

Changes by File:

Test Files:
  • Test/database_test.go

    • Removed import of utilities package
    • Replaced utilities.Must() calls with direct error handling using _ for ignored errors
    • Updated 4 instances of utilities.Must() usage
  • Test/suite.go

    • Removed import of utilities package
    • Replaced utilities.ErrorHandler() calls with local errorHandler() function
    • Added new local errorHandler() function implementation
    • Updated 5 instances across different test suites
  • Test/table_test.go

    • Removed import of utilities package
    • Replaced all utilities.Must() calls with direct tuple unpacking
    • Updated 16 instances of utilities.Must() usage across various test methods
Core Library:
  • tdb/dbOperations.go
    • Removed import of utilities package

    • Inlined utility functions with lowercase naming convention:

      • NewSecureTextEncoder() β†’ newSecureTextEncoder()
      • IsFileExist() β†’ isFileExist()
      • ErrorHandler() β†’ errorHandler()
      • Must() β†’ must()
      • IsEncode() β†’ isEncode()
      • EncodeAndSave() β†’ encodeAndSave()
      • DecodeAndSave() β†’ decodeAndSave()
      • ReadAndDecode() β†’ readAndDecode()
    • Updated 12+ function calls to use new inlined versions

Impact:

  • Simplified dependency structure by removing external utilities package
  • Improved code locality by keeping utility functions close to their usage
  • Maintained functionality while reducing import complexity
  • Enhanced maintainability with fewer package dependencies

Migration Notes:

  • No public API changes - all modifications are internal
  • Test behavior remains unchanged
  • All existing functionality preserved with inlined implementations

This refactoring represents a significant code organization improvement, consolidating utility functions and reducing package complexity while maintaining all existing functionality.