From 3838bebef799352245ed41bf7bd2b947ab32b880 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 25 Nov 2024 14:44:18 +0200 Subject: [PATCH] docs: update example usages by removing deprecated ioutil --- event_parsing.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/event_parsing.go b/event_parsing.go index 0f474211d..eb81fa05c 100644 --- a/event_parsing.go +++ b/event_parsing.go @@ -91,7 +91,7 @@ func HookEventType(r *http.Request) EventType { // Example usage: // // func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// payload, err := ioutil.ReadAll(r.Body) +// payload, err := io.ReadAll(r.Body) // if err != nil { ... } // event, err := gitlab.ParseHook(gitlab.HookEventType(r), payload) // if err != nil { ... } @@ -119,7 +119,7 @@ func ParseHook(eventType EventType, payload []byte) (event interface{}, err erro // Example usage: // // func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// payload, err := ioutil.ReadAll(r.Body) +// payload, err := io.ReadAll(r.Body) // if err != nil { ... } // event, err := gitlab.ParseSystemhook(payload) // if err != nil { ... } @@ -203,7 +203,7 @@ func WebhookEventType(r *http.Request) EventType { // Example usage: // // func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// payload, err := ioutil.ReadAll(r.Body) +// payload, err := io.ReadAll(r.Body) // if err != nil { ... } // event, err := gitlab.ParseWebhook(gitlab.HookEventType(r), payload) // if err != nil { ... }