Skip to content

Commit

Permalink
Removed usage of the deprecated packages
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrinivas8687 committed Feb 11, 2023
1 parent 4bb6fc7 commit 0f9ce4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions services/wireguard/types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package types

import (
"bytes"
"io/ioutil"
"os"
"strings"
"text/template"

Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions services/wireguard/wireguard.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/base64"
"encoding/binary"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 0f9ce4a

Please sign in to comment.