Skip to content

Commit

Permalink
use text/template
Browse files Browse the repository at this point in the history
  • Loading branch information
jtarchie committed Nov 9, 2023
1 parent b049fe1 commit 2277903
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ linters:
- paralleltest
- gomoddirectives
- lll
- revive

# linters deprecated
- deadcode
Expand Down
6 changes: 3 additions & 3 deletions render.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
_ "embed"
"errors"
"fmt"
"html/template"
"net/url"
"os"
"path/filepath"
"strings"
"text/template"
"time"

"github.com/Masterminds/sprig/v3"
Expand Down Expand Up @@ -317,8 +317,8 @@ func (r *Render) renderDocument(doc *Doc, funcMap template.FuncMap, layout *temp

err = layout.Execute(layoutWriter, map[string]any{
"Doc": doc,
//nolint: gosec
"RenderedPage": template.HTML(renderedMarkdown),

"RenderedPage": renderedMarkdown,
})
if err != nil {
return fmt.Errorf("could not render layout template (%s): %w", doc.Filename(), err)
Expand Down
4 changes: 2 additions & 2 deletions watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package builder_test

import (
"errors"
"fmt"
"os"
"path/filepath"
"strconv"

"github.com/jtarchie/builder"
. "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -82,7 +82,7 @@ var _ = Describe("Watcher", func() {
for i := 0; i < 10; i++ {
expectedFilename := filepath.Join(sourceDir, "file")

err = os.WriteFile(expectedFilename, []byte(fmt.Sprintf("%d", i)), os.ModePerm)
err = os.WriteFile(expectedFilename, []byte(strconv.Itoa(i)), os.ModePerm)
Expect(err).NotTo(HaveOccurred())
}

Expand Down

0 comments on commit 2277903

Please sign in to comment.