Skip to content

Commit 93780f9

Browse files
committed
refactor: replace ioutil.ReadAll with io.ReadAll for improved readability
1 parent 5456c71 commit 93780f9

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

backend/src/router/company.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"errors"
77
"fmt"
88
"io"
9-
"io/ioutil"
109
"log"
1110
"net/http"
1211
"strconv"
@@ -905,7 +904,7 @@ func setCompanyPrivateImage(w http.ResponseWriter, r *http.Request) {
905904
var buf bytes.Buffer
906905
checker := io.TeeReader(file, &buf)
907906

908-
bytes, err := ioutil.ReadAll(checker)
907+
bytes, err := io.ReadAll(checker)
909908
if err != nil {
910909
http.Error(w, "Unable to read the file: "+err.Error(), http.StatusExpectationFailed)
911910
return
@@ -985,7 +984,7 @@ func setCompanyPublicImage(w http.ResponseWriter, r *http.Request) {
985984
var buf bytes.Buffer
986985
checker := io.TeeReader(file, &buf)
987986

988-
bytes, err := ioutil.ReadAll(checker)
987+
bytes, err := io.ReadAll(checker)
989988
if err != nil {
990989
http.Error(w, "Unable to read the file: "+err.Error(), http.StatusExpectationFailed)
991990
return

backend/src/router/templates.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"encoding/json"
66
"fmt"
77
"io"
8-
"io/ioutil"
98
"net/http"
109
"strconv"
1110
"text/template"

0 commit comments

Comments
 (0)