(t *testing.T, content string)
| 22 | } |
| 23 | |
| 24 | func httpServerT(t *testing.T, content string) *httptest.Server { |
| 25 | t.Helper() |
| 26 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { |
| 27 | if _, err := fmt.Fprint(w, content); err != nil { |
| 28 | t.Fatalf("%v", err) |
| 29 | } |
| 30 | })) |
| 31 | return ts |
| 32 | } |
| 33 | |
| 34 | func randomString(length int) (string, error) { |
| 35 | letter := []byte("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") |