Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
fix: ioutil deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
dwisiswant0 committed Jan 28, 2023
1 parent e2d841e commit 000c429
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions internal/runner/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"os"
"reflect"
Expand Down Expand Up @@ -131,7 +131,7 @@ func zinc(options *common.Options) string {
}
defer resp.Body.Close()

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
errors.Exit(fmt.Sprint(errors.ErrHealthZinc, ": ", err.Error()))
}
Expand Down Expand Up @@ -163,7 +163,7 @@ func zinc(options *common.Options) string {
}
defer resp.Body.Close()

body, err = ioutil.ReadAll(resp.Body)
body, err = io.ReadAll(resp.Body)
if err != nil {
errors.Exit(fmt.Sprint(errors.ErrAuthZinc, ": ", err.Error()))
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/logs/zinc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"

e "teler.app/pkg/errors"
Expand Down Expand Up @@ -34,7 +34,7 @@ func Zinc(base string, index string, auth string, log map[string]string) error {
}
defer resp.Body.Close()

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/parsers/get.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package parsers

import (
"io/ioutil"
"os"

"gopkg.in/yaml.v2"
)

// GetConfig will parse the config file
func GetConfig(f string) (*Configs, error) {
config := &Configs{}
file, err := ioutil.ReadFile(f)
file, err := os.ReadFile(f)
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/requests/resources.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package requests

import (
"io/ioutil"
"io"
"net/http"
"os"
"path/filepath"
Expand Down Expand Up @@ -60,7 +60,7 @@ func getRules(options *common.Options) {
spin.Suffix = " Getting \"" + cat + "\" resource..."

if cache.Check() && isCached {
content, errCon = ioutil.ReadFile(filepath.Join(cache.Path, fname))
content, errCon = os.ReadFile(filepath.Join(cache.Path, fname))
if errCon != nil {
cache.Purge()

Expand All @@ -81,7 +81,7 @@ func getRules(options *common.Options) {
errors.Exit(err.Error())
}

content, errCon = ioutil.ReadAll(res.Body)
content, errCon = io.ReadAll(res.Body)
if errCon != nil {
errors.Exit(errCon.Error())
}
Expand Down

0 comments on commit 000c429

Please sign in to comment.