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

tlmanz / goconf
0%
master: 0%

Build:
Build:
LAST BUILD BRANCH: refactor/improvements-and-tests
DEFAULT BRANCH: master
Repo Added 12 Aug 2024 07:31PM UTC
Files 0
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

LAST BUILD ON BRANCH refactor/improvements-and-tests
branch: refactor/improvements-and-tests
CHANGE BRANCH
x
Reset
  • refactor/improvements-and-tests
  • master

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

Relevant lines Covered
Build:
Build:
0 RELEVANT LINES 0 COVERED LINES
0.0 HITS PER LINE
Source Files on refactor/improvements-and-tests
Detailed source file information is not available for this build.

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
15214033942 refactor/improvements-and-tests 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 han... Pull #1 23 May 2025 03:38PM UTC google-labs-jules[bot] github
0.0
See All Builds (5)
  • Repo on GitHub
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