Upgrade to go 1.19 and update dependencies (#3069)

* Update to go 1.19
* Update dependencies
* Update cross-compile script
* Add missing targets to cross-compile-all
* Update cache action to remove warning
This commit is contained in:
WithoutPants
2022-11-04 13:41:26 +11:00
committed by GitHub
parent f25881a3bf
commit bba7c23957
939 changed files with 101336 additions and 43819 deletions

View File

@@ -6,6 +6,7 @@ import (
"io"
"os"
"path/filepath"
"strings"
)
// SSHSession represents an SSH Session
@@ -27,6 +28,9 @@ func SSHCopyFileFunc(fn SSHSessionFunc) CopyFileFunc {
return
}
// Escape dir path
d := strings.ReplaceAll(filepath.Dir(dst), " ", "\\ ")
// Using local closure allows better readibility for the defer c.Close() since it
// isolates the use of the ssh session
if err = func() (err error) {
@@ -40,7 +44,7 @@ func SSHCopyFileFunc(fn SSHSessionFunc) CopyFileFunc {
defer c.Close()
// Create the destination folder
if err = s.Run("mkdir -p " + filepath.Dir(dst)); err != nil {
if err = s.Run("mkdir -p " + d); err != nil {
err = fmt.Errorf("astikit: creating %s failed: %w", filepath.Dir(dst), err)
return
}
@@ -70,7 +74,7 @@ func SSHCopyFileFunc(fn SSHSessionFunc) CopyFileFunc {
defer stdin.Close()
// Use "scp" command
if err = s.Start("scp -qt \"" + filepath.Dir(dst) + "\""); err != nil {
if err = s.Start("scp -qt " + d); err != nil {
err = fmt.Errorf("astikit: scp to %s failed: %w", dst, err)
return
}