Skip to content

Commit

Permalink
chore: static checker fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
afonsojramos committed Nov 29, 2023
1 parent 42999d5 commit 70d4dba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/utils/path-utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package utils

import (
"errors"
"io/ioutil"
"os"
"path/filepath"
"runtime"
Expand Down Expand Up @@ -79,7 +78,7 @@ var userAppsFolder = GetUserFolder("CustomApps")
var userExtensionsFolder = GetUserFolder("Extensions")

func GetCustomAppSubfolderPath(folderPath string) string {
entries, err := ioutil.ReadDir(folderPath)
entries, err := os.ReadDir(folderPath)
if err != nil {
return ""
}
Expand Down
7 changes: 3 additions & 4 deletions src/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
Expand Down Expand Up @@ -83,7 +82,7 @@ func Unzip(src, dest string) error {

// Copy .
func Copy(src, dest string, recursive bool, filters []string) error {
dir, err := ioutil.ReadDir(src)
dir, err := os.ReadDir(src)
if err != nil {
return err
}
Expand Down Expand Up @@ -182,15 +181,15 @@ func ReplaceOnce(input *string, regexpTerm string, replaceTerm string) {
// ModifyFile opens file, changes file content by executing
// `repl` callback function and writes new content.
func ModifyFile(path string, repl func(string) string) {
raw, err := ioutil.ReadFile(path)
raw, err := os.ReadFile(path)
if err != nil {
log.Print(err)
return
}

content := repl(string(raw))

ioutil.WriteFile(path, []byte(content), 0700)
os.WriteFile(path, []byte(content), 0700)
}

// GetSpotifyVersion .
Expand Down
4 changes: 2 additions & 2 deletions src/utils/vcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package utils
import (
"encoding/json"
"errors"
"io/ioutil"
"io"
"net/http"
)

Expand All @@ -18,7 +18,7 @@ func FetchLatestTag() (string, error) {
return "", err
}

body, err := ioutil.ReadAll(res.Body)
body, err := io.ReadAll(res.Body)
if err != nil {
return "", err
}
Expand Down

0 comments on commit 70d4dba

Please sign in to comment.