Skip to content

Commit

Permalink
remove deprecated read functions
Browse files Browse the repository at this point in the history
  • Loading branch information
celestix committed May 14, 2024
1 parent 3a0c4b2 commit a7dd467
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package config

import (
"encoding/json"
"io/ioutil"
"os"
"strings"

Expand Down Expand Up @@ -35,7 +34,7 @@ func Load(l *logger.Logger) {
l = l.Create("CONFIG")
defer l.ChangeLevel(logger.LevelMain).Println("LOADED")
initPlatform()
b, err := ioutil.ReadFile("config.json")
b, err := os.ReadFile("config.json")
if err != nil {
if err := ValueOf.setupEnvVars(l); err != nil {
l.ChangeLevel(logger.LevelError).Println(err.Error())
Expand Down
8 changes: 4 additions & 4 deletions utils/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"
"os"
"strconv"
Expand Down Expand Up @@ -38,7 +38,7 @@ func refreshChangelog() error {
if err != nil {
return err
}
b, err := ioutil.ReadAll(resp.Body)
b, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
Expand Down Expand Up @@ -82,7 +82,7 @@ type Update struct {
}

func InitUpdate(l *logger.Logger) {
b, err := ioutil.ReadFile("changelog.json")
b, err := os.ReadFile("changelog.json")
if err != nil {
l.ChangeLevel(logger.LevelCritical).Printlnf("Failed to open changelog.json: %s\n", err.Error())
return
Expand All @@ -106,7 +106,7 @@ func CheckChanges() (*Update, bool) {
if err != nil {
return nil, false
}
b, err := ioutil.ReadAll(resp.Body)
b, err := io.ReadAll(resp.Body)
if err != nil {
return nil, false
}
Expand Down

0 comments on commit a7dd467

Please sign in to comment.