chore(lint): fix warning.

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi.Wu
2022-12-29 21:10:16 +08:00
parent 9aef844da2
commit 4a81a55a53
2 changed files with 2 additions and 7 deletions
+1 -5
View File
@@ -3,7 +3,6 @@ package main
import (
"errors"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -256,10 +255,7 @@ func (p *Plugin) Exec() error {
p.DestFile = fmt.Sprintf("%s.tar", random.String(10))
// create a temporary file for the archive
dir, err := ioutil.TempDir("", "")
if err != nil {
return err
}
dir := os.TempDir()
tar := filepath.Join(dir, p.DestFile)
// run archive command
+1 -2
View File
@@ -1,7 +1,6 @@
package main
import (
"io/ioutil"
"log"
"os"
"os/exec"
@@ -200,7 +199,7 @@ func TestWrongFingerprint(t *testing.T) {
func getHostPublicKeyFile(keypath string) (ssh.PublicKey, error) {
var pubkey ssh.PublicKey
var err error
buf, err := ioutil.ReadFile(keypath)
buf, err := os.ReadFile(keypath)
if err != nil {
return nil, err
}