updating github.go ot use io pkg instead of ioutil pkg after Go 1.21 upgrade

This commit is contained in:
Shawn Hartsell
2024-01-16 15:33:03 -06:00
parent c7838fced0
commit 35c0ff9f0e

View File

@@ -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)
} }