Skip to content

Commit

Permalink
ref: replace deprecated ioutil
Browse files Browse the repository at this point in the history
  • Loading branch information
leukipp committed Jan 12, 2024
1 parent 29b14a3 commit 1193b32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"os"

"io/ioutil"
"path/filepath"

"github.com/BurntSushi/toml"
Expand Down Expand Up @@ -50,7 +49,7 @@ func InitConfig() {

// Write default config if not exists
if _, err := os.Stat(Args.Config); os.IsNotExist(err) {
ioutil.WriteFile(Args.Config, File.Toml, 0644)
os.WriteFile(Args.Config, File.Toml, 0644)
}

// Read config file into memory
Expand Down
5 changes: 2 additions & 3 deletions store/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"time"

"encoding/json"
"io/ioutil"
"path/filepath"

"github.com/BurntSushi/xgb/xproto"
Expand Down Expand Up @@ -214,7 +213,7 @@ func (c *Client) Write() {

// Write client cache
path := filepath.Join(cache.Folder, cache.Name)
err = ioutil.WriteFile(path, data, 0644)
err = os.WriteFile(path, data, 0644)
if err != nil {
log.Warn("Error writing client cache [", c.Latest.Class, "]")
return
Expand All @@ -233,7 +232,7 @@ func (c *Client) Read() *Info {

// Read client info
path := filepath.Join(cache.Folder, cache.Name)
data, err := ioutil.ReadFile(path)
data, err := os.ReadFile(path)
if os.IsNotExist(err) {
log.Info("No client cache found [", c.Latest.Class, "]")
return c.Latest
Expand Down

0 comments on commit 1193b32

Please sign in to comment.