Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: actions/setup-go@v5
with:
# NOTE: Keep this in sync with the version from go.mod
go-version: "1.20.x"
go-version: "1.25.x"
cache: false

- name: Run Benchmarks
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/setup-go@v5
with:
# NOTE: Keep this in sync with the version from go.mod
go-version: '1.20.x'
go-version: '1.25.x'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gosec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '^1.21.x'
go-version: '1.25.x'
check-latest: true
cache: false
- name: Install gosec
Expand Down
78 changes: 39 additions & 39 deletions .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: Govulncheck Security Scan
on:
push:
branches:
- "master"
- "main"
paths-ignore:
- "**.md"
- LICENSE
- ".github/ISSUE_TEMPLATE/*.yml"
- ".github/dependabot.yml"
pull_request:
branches:
- "*"
paths-ignore:
- "**.md"
- LICENSE
- ".github/ISSUE_TEMPLATE/*.yml"
- ".github/dependabot.yml"
jobs:
govulncheck-check:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Fetch Repository
uses: actions/checkout@v5
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
check-latest: true
cache: false
- name: Install Govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Run Govulncheck
run: govulncheck ./...
name: Govulncheck Security Scan

on:
push:
branches:
- "master"
- "main"
paths-ignore:
- "**.md"
- LICENSE
- ".github/ISSUE_TEMPLATE/*.yml"
- ".github/dependabot.yml"
pull_request:
branches:
- "*"
paths-ignore:
- "**.md"
- LICENSE
- ".github/ISSUE_TEMPLATE/*.yml"
- ".github/dependabot.yml"

jobs:
govulncheck-check:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Fetch Repository
uses: actions/checkout@v5
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.25.x'
check-latest: false
cache: false
- name: Install Govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Run Govulncheck
run: govulncheck ./...
7 changes: 1 addition & 6 deletions .github/workflows/test-ace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ jobs:
strategy:
matrix:
go-version:
- 1.17.x
- 1.18.x
- 1.19.x
- 1.20.x
- 1.21.x
- 1.22.x
- 1.25.x
platform: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/test-amber.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ jobs:
strategy:
matrix:
go-version:
- 1.17.x
- 1.18.x
- 1.19.x
- 1.20.x
- 1.21.x
- 1.22.x
- 1.25.x
platform: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/test-django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ jobs:
strategy:
matrix:
go-version:
- 1.18.x
- 1.19.x
- 1.20.x
- 1.21.x
- 1.22.x
- 1.25.x
platform: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/test-handlebars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ jobs:
strategy:
matrix:
go-version:
- 1.17.x
- 1.18.x
- 1.19.x
- 1.20.x
- 1.21.x
- 1.22.x
- 1.25.x
platform: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/test-html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ jobs:
strategy:
matrix:
go-version:
- 1.17.x
- 1.18.x
- 1.19.x
- 1.20.x
- 1.21.x
- 1.22.x
- 1.25.x
platform: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/test-jet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ jobs:
strategy:
matrix:
go-version:
- 1.17.x
- 1.18.x
- 1.19.x
- 1.20.x
- 1.21.x
- 1.22.x
- 1.25.x
platform: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/test-mustache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ jobs:
strategy:
matrix:
go-version:
- 1.17.x
- 1.18.x
- 1.19.x
- 1.20.x
- 1.21.x
- 1.22.x
- 1.25.x
platform: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/test-pug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ jobs:
strategy:
matrix:
go-version:
- 1.17.x
- 1.18.x
- 1.19.x
- 1.20.x
- 1.21.x
- 1.22.x
- 1.25.x
platform: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/test-slim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ jobs:
strategy:
matrix:
go-version:
- 1.17.x
- 1.18.x
- 1.19.x
- 1.20.x
- 1.21.x
- 1.22.x
- 1.25.x
platform: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sidebar_position: 1
<img height="125" alt="Fiber" src="https://raw.githubusercontent.com/gofiber/template/master/.github/logo.svg#gh-light-mode-only" />
<br/>

<a href="https://pkg.go.dev/github.com/gofiber/template?tab=doc">
<a href="https://pkg.go.dev/github.com/gofiber/template/v2?tab=doc">
<img src="https://img.shields.io/badge/%F0%9F%93%9A%20godoc-pkg-00ACD7.svg?color=00ACD7&style=flat"/>
</a>
<a href="https://goreportcard.com/report/github.com/gofiber/template">
Expand All @@ -35,10 +35,10 @@ This package provides universal methods to use multiple template engines with th
- [slim](./slim/README.md) <a href="https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Slim%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/template/test-slim.yml?branch=master&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"/></a>

### Installation
> Go version `1.17` or higher is required.
> Go version `1.25` or higher is required.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The required Go version is set to 1.25, which has not been released yet. This will cause confusion and prevent users from using this library with current stable Go versions. The new code uses reflect.MapRange, which was introduced in Go 1.22. I suggest setting the minimum required version to 1.22.

Suggested change
> Go version `1.25` or higher is required.
> Go version `1.22` or higher is required.


```
go get -u github.com/gofiber/fiber/v2
go get -u github.com/gofiber/fiber/v3
go get -u github.com/gofiber/template/any_template_engine/vX
```

Expand All @@ -49,15 +49,15 @@ package main
import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v3"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The indentation for this import seems to be using spaces instead of a tab, which is inconsistent with the surrounding code and what gofmt would produce. This makes the code block harder to read. This formatting issue is also present in other code examples in this file (e.g., lines 141, 166, 191).

Suggested change
"github.com/gofiber/fiber/v3"
"github.com/gofiber/fiber/v3"


// To use a specific template engine, import as shown below:
// "github.com/gofiber/template/pug"
// "github.com/gofiber/template/mustache"
// "github.com/gofiber/template/pug/v3"
// "github.com/gofiber/template/mustache/v3"
// etc..

// In this example we use the html template engine
"github.com/gofiber/template/html/v2"
"github.com/gofiber/template/html/v3"
)

func main() {
Expand Down Expand Up @@ -93,14 +93,14 @@ func main() {

// To render a template, you can call the ctx.Render function
// Render(tmpl string, values interface{}, layout ...string)
app.Get("/", func(c *fiber.Ctx) error {
app.Get("/", func(c fiber.Ctx) error {
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

// Render with layout example
app.Get("/layout", func(c *fiber.Ctx) error {
app.Get("/layout", func(c fiber.Ctx) error {
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
}, "layouts/main")
Expand Down Expand Up @@ -138,8 +138,8 @@ package main
import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"
"github.com/gofiber/fiber/v3"
"github.com/gofiber/template/html/v3"

"github.com/markbates/pkger"
)
Expand All @@ -163,8 +163,8 @@ package main
import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"
"github.com/gofiber/fiber/v3"
"github.com/gofiber/template/html/v3"

"github.com/gobuffalo/packr/v2"
)
Expand All @@ -188,8 +188,8 @@ package main
import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"
"github.com/gofiber/fiber/v3"
"github.com/gofiber/template/html/v3"

"github.com/GeertJohan/go.rice"
)
Expand All @@ -214,8 +214,8 @@ package main
import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/html"
"github.com/gofiber/fiber/v3"
"github.com/gofiber/template/html/v3"
// your generated package
"github.com/<user>/<repo>/static"
)
Expand Down
8 changes: 4 additions & 4 deletions ace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ package main
import (
"log"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/template/ace/v2"
"github.com/gofiber/fiber/v3"
"github.com/gofiber/template/ace/v3"
Comment on lines +54 to +55
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify version consistency across documentation and implementation.

The README example references github.com/gofiber/fiber/v3 and github.com/gofiber/template/ace/v3, but the actual template engine implementations in this PR (pug.go, html.go, slim.go) import github.com/gofiber/template/v2. Please confirm:

  1. Does ace/v3 exist and is it compatible with the template/v2 core used by other engines?
  2. Should the documentation reference v3 while the implementations remain on v2?

Additionally, replace hard tabs with spaces on these lines to comply with markdown formatting standards.

Apply this diff to fix the indentation:

 import (
-	"log"
-	
-	"github.com/gofiber/fiber/v3"
-	"github.com/gofiber/template/ace/v3"
+  "log"
+  
+  "github.com/gofiber/fiber/v3"
+  "github.com/gofiber/template/ace/v3"
 )

I need to examine the codebase to verify the concerns raised in the review comment. Let me investigate the actual imports and file structure.


🏁 Script executed:

#!/bin/bash
# Find and examine template engine implementation files
echo "=== Searching for template engine files ==="
fd -e go -path "*template*" | head -20

echo ""
echo "=== Examining ace directory structure ==="
fd -type f "ace" | head -20

echo ""
echo "=== Looking for implementation files (pug.go, html.go, slim.go, ace.go) ==="
fd "(pug|html|slim|ace)\.go$"

echo ""
echo "=== Checking ace/README.md content ==="
fd "README.md" -path "*ace*" -exec cat {} \;

echo ""
echo "=== Examining actual imports in template files ==="
if [ -f "pug.go" ]; then echo "=== pug.go ==="; grep -A5 "^import" pug.go; fi
if [ -f "html.go" ]; then echo "=== html.go ==="; grep -A5 "^import" html.go; fi
if [ -f "slim.go" ]; then echo "=== slim.go ==="; grep -A5 "^import" slim.go; fi
if [ -f "ace.go" ]; then echo "=== ace.go ==="; grep -A5 "^import" ace.go; fi

Length of output: 812



🏁 Script executed:

#!/bin/bash
echo "=== ace/ace.go imports ==="
cat ace/ace.go | grep -A10 "^import"

echo ""
echo "=== html/html.go imports ==="
cat html/html.go | grep -A10 "^import"

echo ""
echo "=== pug/pug.go imports ==="
cat pug/pug.go | grep -A10 "^import"

echo ""
echo "=== slim/slim.go imports ==="
cat slim/slim.go | grep -A10 "^import"

echo ""
echo "=== ace/README.md lines 40-55 ==="
cat ace/README.md | sed -n '40,55p'

echo ""
echo "=== Checking for tabs in ace/README.md lines 46-47 ==="
cat ace/README.md | sed -n '46,47p' | od -c | head -20

Length of output: 1018






🏁 Script executed:

#!/bin/bash
echo "=== Detailed view of ace/README.md lines 44-50 ==="
sed -n '44,50p' ace/README.md | cat -A

echo ""
echo "=== Full pug/pug.go imports section ==="
cat pug/pug.go | head -30

Length of output: 662


🌐 Web query:

gofiber template ace v3 compatibility

💡 Result:

Short answer: There is no official github.com/gofiber/template/ace/v3 package — the Ace wrapper is published as v2. So there isn’t an official "ace v3" release to match Fiber v3; use github.com/gofiber/template/ace/v2 (or embed a compatible Ace engine) and the Fiber Views interface instead. Sources: Fiber template docs (Ace examples using ace/v2) and the gofiber/template listing. [1][2]

References

  • Ace wrapper example (ace/v2). [1]
  • gofiber/template package / supported engines listing. [2]

Update README.md to fix version inconsistency and formatting.

The version mismatch is confirmed: all template implementations (ace, html, slim) import github.com/gofiber/template/v2, but the README example references the non-existent github.com/gofiber/template/ace/v3. Change to ace/v2. Additionally, lines 46–47 contain literal tabs that should be spaces per markdown standards.

 import (
-	"log"
-	
-	"github.com/gofiber/fiber/v3"
-	"github.com/gofiber/template/ace/v3"
+  "log"
+  
+  "github.com/gofiber/fiber/v3"
+  "github.com/gofiber/template/ace/v2"
 )
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

46-46: Hard tabs
Column: 1

(MD010, no-hard-tabs)


47-47: Hard tabs
Column: 1

(MD010, no-hard-tabs)

🤖 Prompt for AI Agents
In ace/README.md around lines 46–47, the README shows an incorrect import and
contains literal tabs; update the import path from
github.com/gofiber/template/ace/v3 to github.com/gofiber/template/ace/v2 to
match the rest of the templates, and replace any literal tab characters on those
lines with spaces to conform to Markdown formatting standards.

)

func main() {
Expand All @@ -60,14 +60,14 @@ func main() {
Views: engine,
})

app.Get("/", func(c *fiber.Ctx) error {
app.Get("/", func(c fiber.Ctx) error {
// Render index
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})

app.Get("/layout", func(c *fiber.Ctx) error {
app.Get("/layout", func(c fiber.Ctx) error {
// Render index within layouts/main
return c.Render("index", fiber.Map{
"Title": "Hello, World!",
Expand Down
2 changes: 1 addition & 1 deletion ace/ace.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"path/filepath"
"strings"

core "github.com/gofiber/template"
core "github.com/gofiber/template/v2"
"github.com/gofiber/utils"
"github.com/yosssi/ace"
)
Expand Down
8 changes: 4 additions & 4 deletions ace/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/gofiber/template/ace/v2
module github.com/gofiber/template/ace/v3

go 1.17
go 1.25

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The go directive is set to 1.25, which is an unreleased version of Go. This will cause build failures for users on stable Go toolchains. The new code seems to require features from Go 1.22 (like reflect.MapRange), so the version should probably be 1.22. This change is needed in all go.mod files across the repository.

Suggested change
go 1.25
go 1.22


require github.com/yosssi/ace v0.0.5

require (
github.com/gofiber/template v1.8.3
github.com/gofiber/template/v2 v2.0.0
github.com/gofiber/utils v1.1.0
github.com/stretchr/testify v1.11.1
)
Expand All @@ -16,4 +16,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/gofiber/template => ../.
replace github.com/gofiber/template/v2 => ../.
Loading
Loading