diff --git a/services/wireguard/types/config.go b/services/wireguard/types/config.go index ac04f20..e16bc45 100644 --- a/services/wireguard/types/config.go +++ b/services/wireguard/types/config.go @@ -2,7 +2,7 @@ package types import ( "bytes" - "io/ioutil" + "os" "strings" "text/template" @@ -80,7 +80,7 @@ func (c *Config) SaveToPath(path string) error { return err } - return ioutil.WriteFile(path, buffer.Bytes(), 0600) + return os.WriteFile(path, buffer.Bytes(), 0600) } func (c *Config) String() string { diff --git a/services/wireguard/wireguard.go b/services/wireguard/wireguard.go index 3e048dc..e1773c4 100644 --- a/services/wireguard/wireguard.go +++ b/services/wireguard/wireguard.go @@ -5,7 +5,6 @@ import ( "encoding/base64" "encoding/binary" "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -67,7 +66,7 @@ func (w *WireGuard) Init(home string) (err error) { } path := fmt.Sprintf("/etc/wireguard/%s.conf", w.cfg.Interface) - if err := ioutil.WriteFile(path, buffer.Bytes(), 0600); err != nil { + if err := os.WriteFile(path, buffer.Bytes(), 0600); err != nil { return err }