• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tlmanz / goconf / 15214033942
0%
master: 0%

Build:
Build:
LAST BUILD BRANCH: refactor/improvements-and-tests
DEFAULT BRANCH: master
Ran 23 May 2025 03:38PM UTC
Jobs 1
Files 0
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 May 2025 03:36PM UTC coverage: 0.0%. Remained the same
15214033942

Pull #1

github

google-labs-jules[bot]
Refactor: Improve error handling, add tests, and update deps

This commit introduces several improvements to the goconf package:

1.  **Error Handling:**
    - `printTable` now returns errors instead of calling `log.Fatal`, allowing callers to handle issues more gracefully.
    - `printTable` now accepts an `io.Writer` for more flexible output destinations.
    - The `Load` function now accumulates all errors encountered during the processing of configurations (Register, Validate, Print) and returns them as a single, consolidated error. This provides a more complete report of failures.

2.  **Unit Tests:**
    - Added a new test suite in `register_test.go`.
    - Implemented tests for the `Load` function, covering success cases, registration failures, validation failures, and multiple error accumulation.
    - Implemented tests for the (unexported) `printTable` function, verifying successful output to a buffer.
    - Mock implementations for `Configer`, `Validater`, and `Printer` interfaces were created to facilitate testing.
    - Noted that simulating errors from the `hush.Hush` library proved difficult with simple mock data, and tests were adjusted accordingly.

3.  **Dependencies:**
    - Updated `github.com/tlmanz/hush` from `v0.2.1` to `v0.2.3`.
    - Other dependencies (`olekukonko/tablewriter`, `tryfix/log`) could not be updated due to their newer versions requiring a higher Go version than the project's current `go 1.21.7`.

4.  **Minor Considerations:**
    - The pattern of calling `hush.NewHush()` within `printTable` was reviewed. Given its likely lightweight nature, no changes were made to this for now, prioritizing code simplicity.

These changes enhance the robustness, testability, and maintainability of the goconf package.
Pull Request #1: Refactor: Improve error handling, add tests, and update deps

0 of 0 relevant lines covered (NaN%)

0.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 15214033942.1 23 May 2025 03:38PM UTC 0
0.0
GitHub Action Run
Source Files on build 15214033942
Detailed source file information is not available for this build.
  • Back to Repo
  • Pull Request #1
  • PR Base - master (#10375104274)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc