diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-11-21 21:59:38 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-11-22 18:41:50 +0100 |
commit | a3fe5e5e35f311f22b6b4fc38abfcf64cd2c7d6f (patch) | |
tree | 06cf1f647ae026b4fb3053c85370c2b203c7a089 /common/para | |
parent | cd07e6d57b158a76f812e8c4c9567dbc84f57939 (diff) |
Fix Params case handling in the index, sort and where func
This means that you can now do:
```
{{ range where .Site.Pages "Params.MYPARAM" "foo" }}
```
Diffstat (limited to 'common/para')
-rw-r--r-- | common/para/para.go | 6 | ||||
-rw-r--r-- | common/para/para_test.go | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/common/para/para.go b/common/para/para.go index 319bdb78f..69bfc205b 100644 --- a/common/para/para.go +++ b/common/para/para.go @@ -37,8 +37,8 @@ type Runner interface { type errGroupRunner struct { *errgroup.Group - w *Workers - ctx context.Context + w *Workers + ctx context.Context } func (g *errGroupRunner) Run(fn func() error) { @@ -68,6 +68,6 @@ func (w *Workers) Start(ctx context.Context) (Runner, context.Context) { return &errGroupRunner{ Group: g, ctx: ctx, - w: w, + w: w, }, ctx } diff --git a/common/para/para_test.go b/common/para/para_test.go index 9f33a234c..bda7f5d27 100644 --- a/common/para/para_test.go +++ b/common/para/para_test.go @@ -15,6 +15,7 @@ package para import ( "context" + "runtime" "sort" "sync" "sync/atomic" @@ -25,6 +26,9 @@ import ( ) func TestPara(t *testing.T) { + if runtime.NumCPU() < 4 { + t.Skipf("skip para test, CPU count is %d", runtime.NumCPU()) + } c := qt.New(t) |