replace deprecated ioutils

This commit is contained in:
Robert Kaussow 2022-08-05 13:10:22 +02:00
parent 16349ada30
commit b87179a15b
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
2 changed files with 4 additions and 5 deletions

View File

@ -1,7 +1,7 @@
package plugin
import (
"io/ioutil"
"io"
"os"
)
@ -17,8 +17,8 @@ func (p Plugin) startDaemon() {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
} else {
cmd.Stdout = ioutil.Discard
cmd.Stderr = ioutil.Discard
cmd.Stdout = io.Discard
cmd.Stderr = io.Discard
}
go func() {
trace(cmd)

View File

@ -2,7 +2,6 @@ package plugin
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
@ -129,7 +128,7 @@ func (p *Plugin) Execute() error {
}
path := filepath.Join(dockerHome, "config.json")
err := ioutil.WriteFile(path, []byte(p.settings.Login.Config), 0o600)
err := os.WriteFile(path, []byte(p.settings.Login.Config), 0o600)
if err != nil {
return fmt.Errorf("error writing config.json: %s", err)
}