mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-01 22:42:45 +02:00
Pull in latest Go template source
This commit is contained in:
@@ -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 {
|
||||
|
@@ -5,7 +5,6 @@
|
||||
package testenv
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
@@ -16,7 +15,7 @@ var symlinkOnce sync.Once
|
||||
var winSymlinkErr error
|
||||
|
||||
func initWinHasSymlink() {
|
||||
tmpdir, err := ioutil.TempDir("", "symtest")
|
||||
tmpdir, err := os.MkdirTemp("", "symtest")
|
||||
if err != nil {
|
||||
panic("failed to create temp directory: " + err.Error())
|
||||
}
|
||||
|
Reference in New Issue
Block a user