From 8f012fc275c49fdbc740dae70539bc70a719d9d5 Mon Sep 17 00:00:00 2001 From: idanoo Date: Sun, 20 Nov 2022 17:56:51 +1300 Subject: [PATCH] Remove duplicate handling --- main.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/main.go b/main.go index 482bedb..de34f1e 100644 --- a/main.go +++ b/main.go @@ -2,8 +2,6 @@ package main import ( "encoding/json" - "fmt" - "io" "log" "net/http" "os" @@ -51,19 +49,7 @@ func main() { } func handler(w http.ResponseWriter, r *http.Request) { - var bodyBytes []byte - var err error - if r.Body != nil { - bodyBytes, err = io.ReadAll(r.Body) - if err != nil { - fmt.Printf("Body reading error: %v", err) - return - } - defer r.Body.Close() - } - - if len(bodyBytes) > 0 { var i IdentifyingRequest err := json.NewDecoder(r.Body).Decode(&i) if err != nil {