Skip to content

Conversation

@miladev95
Copy link
Contributor

Added two small tests to internal/bytesconv/bytesconv_test.go:

TestBytesToStringEmpty — asserts BytesToString([]byte{}) and BytesToString(nil) return "".
TestStringToBytesEmpty — asserts StringToBytes("") returns an empty []byte. Verified with go test ./internal/bytesconv -v.

@codecov
Copy link

codecov bot commented Nov 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.91%. Comparing base (3dc1cd6) to head (ddb67d1).
⚠️ Report is 219 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4454      +/-   ##
==========================================
- Coverage   99.21%   98.91%   -0.30%     
==========================================
  Files          42       44       +2     
  Lines        3182     2959     -223     
==========================================
- Hits         3157     2927     -230     
- Misses         17       19       +2     
- Partials        8       13       +5     
Flag Coverage Δ
?
--ldflags="-checklinkname=0" -tags sonic 98.91% <ø> (?)
-tags go_json 98.77% <ø> (?)
-tags nomsgpack 98.83% <ø> (?)
go-1.18 ?
go-1.19 ?
go-1.20 ?
go-1.21 ?
go-1.24 98.91% <ø> (?)
go-1.25 98.85% <ø> (?)
macos-latest 98.85% <ø> (-0.37%) ⬇️
ubuntu-latest 98.91% <ø> (-0.30%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@appleboy appleboy changed the title internal/bytesconv: add tests for empty/nil cases test(bytesconv): add tests for empty/nil cases Nov 30, 2025
@appleboy appleboy added the test label Nov 30, 2025
@appleboy appleboy added this to the v1.12 milestone Nov 30, 2025
@appleboy appleboy merged commit 583db59 into gin-gonic:master Nov 30, 2025
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants