chore: fix lint errors (#2520)

This commit is contained in:
Kevin Wan
2022-10-17 06:30:58 +08:00
committed by GitHub
parent d4c9fd2aff
commit 05a5de7c6d
27 changed files with 117 additions and 148 deletions

View File

@@ -1,6 +1,7 @@
package internal
import (
"net/http"
"net/http/httptest"
"testing"
"time"
@@ -9,14 +10,14 @@ import (
)
func TestGetTimeout(t *testing.T) {
req := httptest.NewRequest("GET", "/", nil)
req := httptest.NewRequest("GET", "/", http.NoBody)
req.Header.Set(grpcTimeoutHeader, "1s")
timeout := GetTimeout(req.Header, time.Second*5)
assert.Equal(t, time.Second, timeout)
}
func TestGetTimeoutDefault(t *testing.T) {
req := httptest.NewRequest("GET", "/", nil)
req := httptest.NewRequest("GET", "/", http.NoBody)
timeout := GetTimeout(req.Header, time.Second*5)
assert.Equal(t, time.Second*5, timeout)
}