Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .husky/hooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

if [[ -n "$(git status --short)" ]]; then
if git status --short | grep -qv "??"; then
git stash
function unstash() {
git reset --hard
Expand Down
4 changes: 2 additions & 2 deletions pkg/utils/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ package utils

import (
"fmt"
"io/ioutil"
"os"
"strings"
)

// ReadFile reads a file from the given path.
func ReadFile(path string) (string, error) {
content, err := ioutil.ReadFile(path)
content, err := os.ReadFile(path)
if err != nil {
return "", fmt.Errorf("unable to read secret: %s, error: %s", path, err)
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/utils/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"strings"
"time"
Expand Down Expand Up @@ -77,7 +76,7 @@ func doHttpRequest(method, url string, body io.Reader, headers map[string]string
}

defer resp.Body.Close()
content, err := ioutil.ReadAll(resp.Body)
content, err := io.ReadAll(resp.Body)
if err != nil {
logger.Error(err, "Unable to read content")
return nil, resp.StatusCode, errors.Wrap(err, "unable to read HTTP response")
Expand Down