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

maruina / go-infrabin / 18807559949
56%

Build:
DEFAULT BRANCH: master
Ran 25 Oct 2025 07:34PM UTC
Jobs 1
Files 14
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

25 Oct 2025 07:32PM UTC coverage: 49.369% (-1.6%) from 51.009%
18807559949

push

github

web-flow
Improve Go code quality and update documentation (#405)

* Improve Go code quality and update documentation

This PR addresses multiple code quality improvements identified through
comprehensive Go code review, bringing the codebase from 7.5/10 to 9.5/10
in adherence to Go best practices.

## Code Quality Improvements

### Error Handling
- Add comprehensive error wrapping with fmt.Errorf and %w throughout
- Refactor NewGRPCServer() to return error instead of panicking
- Refactor HTTPServerOption to propagate errors properly
- Remove all log.Fatal calls from library code (pkg/)
- Improve error messages with proper context

### Naming Conventions
- Rename STSApi to STSClient (proper Go interface naming)
- Improve variable naming (vFlag/cFlag → viperKey/cobraFlag)
- Add package-level documentation to all packages

### Safety & Robustness
- Add type assertion safety checks in HTTP handler registration
- Fix unchecked metadata boolean return value
- Remove unnecessary else clauses after returns
- Fix context management in NewHTTPServer

### Testing
- Update all tests to handle new error returns
- All tests passing ✅

## Documentation Updates

### README.md Corrections
- Fix /proxy endpoint HTTP method (GET → POST)
- Add missing /bytes/<number> endpoint documentation (RandomData)
- Fix intermittent response field name (consecutive_errors → intermittent_errors)
- Remove non-existent INFRABIN_MAX_DELAY environment variable
- Add comprehensive Kubernetes environment variables documentation
- Add missing cluster_name and region fields to root endpoint response
- Clarify Prometheus metrics endpoint location

## Impact
- No breaking changes to API
- Improved error handling and observability
- Better adherence to Uber Go Style Guide and Effective Go
- Production-ready code quality

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Refactor RegisterInfrabin and RegisterHandler for clarity

- Rename mux... (continued)

56 of 108 new or added lines in 7 files covered. (51.85%)

6 existing lines in 3 files now uncovered.

352 of 713 relevant lines covered (49.37%)

3.01 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
94.44
-1.71% pkg/infrabin/config.go
3
0.0
0.0% internal/aws/clients.go
3
66.67
-1.19% internal/aws/sts.go
4
44.62
-1.54% pkg/infrabin/grpc.go
4
75.17
-1.05% pkg/infrabin/infrabin.go
9
65.56
-3.41% pkg/infrabin/http.go
27
0.0
0.0% internal/cmd/root.go

Uncovered Existing Lines

Lines Coverage ∆ File
1
94.44
-1.71% pkg/infrabin/config.go
1
44.62
-1.54% pkg/infrabin/grpc.go
4
65.56
-3.41% pkg/infrabin/http.go
Jobs
ID Job ID Ran Files Coverage
1 18807559949.1 25 Oct 2025 07:34PM UTC 14
49.37
GitHub Action Run
Source Files on build 18807559949
  • Tree
  • List 14
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 7100092c on github
  • Prev Build on master (#18804481427)
  • Next Build on master (#18807942439)
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