updating github.go ot use io pkg instead of ioutil pkg after Go 1.21 upgrade
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"html"
|
"html"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -71,7 +71,7 @@ func main() {
|
|||||||
}).Methods("POST")
|
}).Methods("POST")
|
||||||
|
|
||||||
r.HandleFunc("/api/v3/admin/organizations", func(w http.ResponseWriter, r *http.Request) {
|
r.HandleFunc("/api/v3/admin/organizations", func(w http.ResponseWriter, r *http.Request) {
|
||||||
b, err := ioutil.ReadAll(r.Body)
|
b, err := io.ReadAll(r.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@ func main() {
|
|||||||
|
|
||||||
r.HandleFunc("/api/v3/orgs/{org}/repos", func(w http.ResponseWriter, r *http.Request) {
|
r.HandleFunc("/api/v3/orgs/{org}/repos", func(w http.ResponseWriter, r *http.Request) {
|
||||||
orgName := mux.Vars(r)["org"]
|
orgName := mux.Vars(r)["org"]
|
||||||
b, err := ioutil.ReadAll(r.Body)
|
b, err := io.ReadAll(r.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@@ -178,7 +178,7 @@ func main() {
|
|||||||
}).Methods("POST")
|
}).Methods("POST")
|
||||||
|
|
||||||
r.HandleFunc("/api/v3/user/repos", func(w http.ResponseWriter, r *http.Request) {
|
r.HandleFunc("/api/v3/user/repos", func(w http.ResponseWriter, r *http.Request) {
|
||||||
b, err := ioutil.ReadAll(r.Body)
|
b, err := io.ReadAll(r.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user