1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-07-12 22:21:40 +02:00

Dedup code and migrate away from deprecated funcs (#1141)

Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
6543
2022-08-30 01:14:07 +02:00
committed by GitHub
parent ca84f703e3
commit 08a99152d6
25 changed files with 86 additions and 113 deletions

View File

@ -17,7 +17,7 @@ package coding
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"regexp"
"strings"
@ -94,7 +94,7 @@ type MergeRequestHook struct {
}
func parseHook(r *http.Request) (*model.Repo, *model.Build, error) {
raw, err := ioutil.ReadAll(r.Body)
raw, err := io.ReadAll(r.Body)
defer r.Body.Close()
if err != nil {
return nil, nil, err