mccutchen / go-httpbin

A reasonably complete and well-tested golang port of httpbin, with zero dependencies outside the go stdlib.
https://httpbingo.org
MIT License
596 stars 124 forks source link

refactor: minor tweaks to `/drip` implementation #185

Closed mccutchen closed 2 months ago

mccutchen commented 2 months ago

A handful of drive-by tweaks to the /drip implementation:

This also includes a small fix to the internal testing library, dropping the assert.RoughDuration() helper in favor of an updated generic assert.RoughlyEqual() implementation that works with the time.Duration type.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.13%. Comparing base (24529f4) to head (5574709). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #185 +/- ## ========================================== - Coverage 95.13% 95.13% -0.01% ========================================== Files 10 10 Lines 1726 1725 -1 ========================================== - Hits 1642 1641 -1 Misses 48 48 Partials 36 36 ``` | [Files with missing lines](https://app.codecov.io/gh/mccutchen/go-httpbin/pull/185?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Will+McCutchen) | Coverage Δ | | |---|---|---| | [httpbin/handlers.go](https://app.codecov.io/gh/mccutchen/go-httpbin/pull/185?src=pr&el=tree&filepath=httpbin%2Fhandlers.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Will+McCutchen#diff-aHR0cGJpbi9oYW5kbGVycy5nbw==) | `99.21% <100.00%> (-0.01%)` | :arrow_down: |