Skip to content

Update Go version and CI to modern standards#7

Open
ozgio wants to merge 2 commits intomasterfrom
modernize-go-version
Open

Update Go version and CI to modern standards#7
ozgio wants to merge 2 commits intomasterfrom
modernize-go-version

Conversation

@ozgio
Copy link
Copy Markdown
Owner

@ozgio ozgio commented May 21, 2025

This commit updates the project to use Go 1.22.

Changes include:

  • Updated go.mod to go 1.22.
  • Updated the GitHub Actions workflow (.github/workflows/test.yml):
    • Tests now run against Go 1.21.x and 1.22.x.
    • Upgraded golangci/golangci-lint-action to v3.7.0.
    • Upgraded golangci-lint version to v1.55.
  • Ran go mod tidy to ensure module files are consistent.

All tests and linters pass with these new versions. No code changes were required to adapt to the updated Go version or linters.

This commit updates the project to use Go 1.22.

Changes include:
- Updated `go.mod` to `go 1.22`.
- Updated the GitHub Actions workflow (`.github/workflows/test.yml`):
    - Tests now run against Go 1.21.x and 1.22.x.
    - Upgraded `golangci/golangci-lint-action` to `v3.7.0`.
    - Upgraded `golangci-lint` version to `v1.55`.
- Ran `go mod tidy` to ensure module files are consistent.

All tests and linters pass with these new versions. No code changes were required to adapt to the updated Go version or linters.
@ozgio ozgio self-assigned this May 21, 2025
This commit significantly enhances test coverage for the string alignment and
case conversion functionalities by adding numerous new table-driven test cases.

Key changes include:

1.  **Enhanced `align_test.go`:**
    *   Added comprehensive tests for `Align`, `AlignLeft`, `AlignRight`,
        `AlignCenter`, and `CenterText`.
    *   Covered edge cases such as empty strings, strings with only spaces,
        zero width, width less than string length, and various newline scenarios.
    *   Included tests for multi-byte Unicode characters to ensure correct handling.

2.  **Enhanced `case_test.go`:**
    *   Added comprehensive tests for `ToSnakeCase`, `ToCamelCase`, and
        `SplitCamelCase`.
    *   Covered scenarios like multiple consecutive spaces, leading/trailing
        spaces, strings already in the target case, and strings with numbers.
    *   For `SplitCamelCase`, added complex cases including mixed alphanumeric
        sequences (e.g., "Version10Release2"), various acronym and number
        combinations (e.g., "SKU1000", "NASA2024Projects"), and challenging
        upper/lower/digit transitions (e.g., "userID", "IPAddress").
    *   Included Unicode examples and tests for non-camel-case inputs.

All new and existing tests pass, and the codebase conforms to `golangci-lint`
standards.

This work addresses your request to improve test coverage and ensure
robustness of these utility functions. While an initial attempt to retrieve
quantitative test coverage data faced difficulties with the reporting mechanism,
a qualitative analysis guided the selection of these key areas for test
enhancement.
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