Skip to content
This repository was archived by the owner on Dec 10, 2024. It is now read-only.

Commit e884d22

Browse files
authored
Merge pull request #2068 from alexandear/docs/ioutil-deprecated
docs: update example usages by removing deprecated ioutil
2 parents 42949f8 + 3838beb commit e884d22

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

event_parsing.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func HookEventType(r *http.Request) EventType {
9191
// Example usage:
9292
//
9393
// func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
94-
// payload, err := ioutil.ReadAll(r.Body)
94+
// payload, err := io.ReadAll(r.Body)
9595
// if err != nil { ... }
9696
// event, err := gitlab.ParseHook(gitlab.HookEventType(r), payload)
9797
// if err != nil { ... }
@@ -119,7 +119,7 @@ func ParseHook(eventType EventType, payload []byte) (event interface{}, err erro
119119
// Example usage:
120120
//
121121
// func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
122-
// payload, err := ioutil.ReadAll(r.Body)
122+
// payload, err := io.ReadAll(r.Body)
123123
// if err != nil { ... }
124124
// event, err := gitlab.ParseSystemhook(payload)
125125
// if err != nil { ... }
@@ -203,7 +203,7 @@ func WebhookEventType(r *http.Request) EventType {
203203
// Example usage:
204204
//
205205
// func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
206-
// payload, err := ioutil.ReadAll(r.Body)
206+
// payload, err := io.ReadAll(r.Body)
207207
// if err != nil { ... }
208208
// event, err := gitlab.ParseWebhook(gitlab.HookEventType(r), payload)
209209
// if err != nil { ... }

0 commit comments

Comments
 (0)