mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-02 04:51:29 +02:00
Fix lint and failing tests
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user