Workaround for https://github.com/golang/go/issues/49366
/hugo
docs/public*
/.idea
+.vscode/*
hugo.exe
*.test
*.prof
}
}
- cache := NewCache(afero.NewMemMapFs(), 100*time.Hour, "")
+ cache := NewCache(afero.NewMemMapFs(), 100*time.Hour, 0, "")
const id = "a32"
import (
"bufio"
"bytes"
+ "context"
"fmt"
"io"
"io/ioutil"
}
addUserProvidedHeaders(headers, req)
}
+
+ // Workaround for https://github.com/golang/go/issues/49366
+ // This is the entire lifetime of the request.
+ ctx, cancel := context.WithTimeout(req.Context(), 30*time.Second)
+ defer cancel()
+
+ req = req.WithContext(ctx)
+
res, err := c.httpClient.Do(req)
if err != nil {
return nil, err
"github.com/gohugoio/hugo/hugofs"
"github.com/gohugoio/hugo/langs"
"github.com/spf13/afero"
-
)
func TestScpGetLocal(t *testing.T) {
t.Parallel()
c := qt.New(t)
fs := new(afero.MemMapFs)
- cache := filecache.NewCache(fs, 100, "")
+ cache := filecache.NewCache(fs, 100, 0, "")
tests := []struct {
path string