• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wrouesnel / p2cli / 13113960990

03 Feb 2025 12:55PM UTC coverage: 34.911%. Remained the same
13113960990

Pull #72

github

web-flow
Bump github.com/samber/lo from 1.47.0 to 1.49.1

Bumps [github.com/samber/lo](https://github.com/samber/lo) from 1.47.0 to 1.49.1.
- [Release notes](https://github.com/samber/lo/releases)
- [Commits](https://github.com/samber/lo/compare/v1.47.0...v1.49.1)

---
updated-dependencies:
- dependency-name: github.com/samber/lo
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #72: Bump github.com/samber/lo from 1.47.0 to 1.49.1

332 of 951 relevant lines covered (34.91%)

25.43 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pkg/templating/engine.go
1
package templating
2

3
import (
4
        "io"
5

6
        "github.com/flosch/pongo2/v6"
7
        "github.com/pkg/errors"
8
)
9

10
type TemplateEngine struct {
11
        // PrepareOutput is invoked before the engine writes a file and must return a writer
12
        // which directs the byte output to correct location, and a finalizer function which
13
        // can be called to finish the write operation.
14
        PrepareOutput func(inputData pongo2.Context, outputPath string) (io.Writer, func() error, error)
15
}
16

17
func (te *TemplateEngine) ExecuteTemplate(filterSet *FilterSet, tmpl *LoadedTemplate,
18
        inputData pongo2.Context, outputPath string) error {
×
19
        outputWriter, finalizer, err := te.PrepareOutput(inputData, outputPath)
×
20
        if err != nil {
×
21
                return errors.Wrap(err, "ExecuteTemplate")
×
22
        }
×
23

24
        ctx := make(pongo2.Context)
×
25
        ctx.Update(inputData)
×
26

×
27
        // Parallelism risk! This is a really hacky way to implement this functionality,
×
28
        // and creates all sorts of problems if this is ever used concurrently. We need
×
29
        // changes to Pongo2 (ideally per templateset filters) in order to avoid this.
×
30
        filterSet.OutputFileName = outputPath
×
31
        if err := tmpl.Template.ExecuteWriter(ctx, outputWriter); err != nil {
×
32
                return errors.Wrap(err, "ExecuteTemplate template error")
×
33
        }
×
34

35
        if finalizer != nil {
×
36
                if err := finalizer(); err != nil {
×
37
                        return errors.Wrap(err, "ExecuteTemplate finalizer error")
×
38
                }
×
39
        }
40

41
        return nil
×
42
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc