Fix lint and failing tests

This commit is contained in:
Viktor Liu
2026-02-12 18:19:13 +01:00
parent 57d3ee5aac
commit eea7687ddf
4 changed files with 11 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ import (
// that no lock was acquired; callers must treat a nil file as "proceed
// without lock" rather than "lock held by someone else."
func Lock(_ context.Context, _ string) (*os.File, error) {
return nil, nil
return nil, nil //nolint:nilnil // intentional: nil file signals locking unsupported on this platform
}
// Unlock is a no-op on non-Unix platforms.

View File

@@ -53,6 +53,9 @@ func TestMetrics_RoundTripper(t *testing.T) {
t.Run(name, func(t *testing.T) {
rt := m.RoundTripper(test.roundTripper)
res, err := rt.RoundTrip(test.request)
if res != nil && res.Body != nil {
defer res.Body.Close()
}
if diff := cmp.Diff(test.err, err); diff != "" {
t.Errorf("Incorrect error (-want +got):\n%s", diff)
}