Pull in latest Go template source

This commit is contained in:
Bjørn Erik Pedersen
2021-01-29 17:15:42 +01:00
parent 21e9eb18ac
commit ccb822eb5a
11 changed files with 157 additions and 20 deletions

View File

@@ -13,6 +13,7 @@ package testenv
import (
"errors"
"flag"
"github.com/gohugoio/hugo/tpl/internal/go_templates/cfg"
"os"
"os/exec"
"path/filepath"
@@ -21,9 +22,6 @@ import (
"strings"
"sync"
"testing"
"github.com/cli/safeexec"
"github.com/gohugoio/hugo/tpl/internal/go_templates/cfg"
)
// Builder reports the name of the builder running this test
@@ -109,7 +107,7 @@ func GoTool() (string, error) {
if _, err := os.Stat(path); err == nil {
return path, nil
}
goBin, err := safeexec.LookPath("go" + exeSuffix)
goBin, err := exec.LookPath("go" + exeSuffix)
if err != nil {
return "", errors.New("cannot find go tool: " + err.Error())
}
@@ -154,7 +152,7 @@ func MustHaveExecPath(t testing.TB, path string) {
err, found := execPaths.Load(path)
if !found {
_, err = safeexec.LookPath(path)
_, err = exec.LookPath(path)
err, _ = execPaths.LoadOrStore(path, err)
}
if err != nil {