Repository: lxc/distrobuilder (go)

Issue:
Update to flosch/pongo2.v4?
Currently distrobuilder depends on both `github.com/flosch/pongo2` and `gopkg.in/flosch/pongo2.v3`. Is there a particular reason why there are two different versions of this library being used? Selfishly asking with my packager hat on, could distrobuilder update to `flosch/pongo2.v4`? I know it's not the most current version of that library, but it is already packaged in Debian. :grinning: 

Pull request:
Bump pongo2 to v4
Closes #819

Patch:
diff --git a/distrobuilder/main_repack-windows.go b/distrobuilder/main_repack-windows.go
index 76735f2..0f09be0 100644
--- a/distrobuilder/main_repack-windows.go
+++ b/distrobuilder/main_repack-windows.go
@@ -14,7 +14,7 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/flosch/pongo2"
+	"github.com/flosch/pongo2/v4"
 	incus "github.com/lxc/incus/shared/util"
 	"github.com/sirupsen/logrus"
 	"github.com/spf13/cobra"
diff --git a/generators/template.go b/generators/template.go
index 5ff9559..a3a2b13 100644
--- a/generators/template.go
+++ b/generators/template.go
@@ -6,7 +6,7 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/flosch/pongo2"
+	"github.com/flosch/pongo2/v4"
 	"github.com/lxc/incus/shared/api"
 
 	"github.com/lxc/distrobuilder/image"
diff --git a/go.mod b/go.mod
index 6ada848..0269e02 100644
--- a/go.mod
+++ b/go.mod
@@ -44,6 +44,7 @@ require (
 	github.com/docker/go-connections v0.5.0 // indirect
 	github.com/docker/go-units v0.5.0 // indirect
 	github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
+	github.com/flosch/pongo2/v4 v4.0.2 // indirect
 	github.com/fsouza/go-dockerclient v1.10.2 // indirect
 	github.com/gogo/protobuf v1.3.2 // indirect
 	github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
diff --git a/go.sum b/go.sum
index 4bc09d7..1108372 100644
--- a/go.sum
+++ b/go.sum
@@ -101,6 +101,8 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv
 github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
 github.com/flosch/pongo2 v0.0.0-20200913210552-0d938eb266f3 h1:fmFk0Wt3bBxxwZnu48jqMdaOR/IZ4vdtJFuaFV8MpIE=
 github.com/flosch/pongo2 v0.0.0-20200913210552-0d938eb266f3/go.mod h1:bJWSKrZyQvfTnb2OudyUjurSG4/edverV7n82+K3JiM=
+github.com/flosch/pongo2/v4 v4.0.2 h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0Hw=
+github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8=
 github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/fsouza/go-dockerclient v1.6.4/go.mod h1:GOdftxWLWIbIWKbIMDroKFJzPdg6Iw7r+jX1DDZdVsA=
diff --git a/shared/util.go b/shared/util.go
index 2f70161..694a07b 100644
--- a/shared/util.go
+++ b/shared/util.go
@@ -12,9 +12,9 @@ import (
 	"strings"
 	"time"
 
+	"github.com/flosch/pongo2/v4"
 	"github.com/lxc/incus/shared/util"
 	"golang.org/x/sys/unix"
-	"gopkg.in/flosch/pongo2.v3"
 	yaml "gopkg.in/yaml.v2"
 )
 


Test patch:
diff --git a/shared/util_test.go b/shared/util_test.go
index b581202..3361027 100644
--- a/shared/util_test.go
+++ b/shared/util_test.go
@@ -5,8 +5,8 @@ import (
 	"os"
 	"testing"
 
+	"github.com/flosch/pongo2/v4"
 	"github.com/stretchr/testify/require"
-	"gopkg.in/flosch/pongo2.v3"
 )
 
 func TestRenderTemplate(t *testing.T) {