From 2ec64dc92bb1d232e8b850f007f1708226fbce90 Mon Sep 17 00:00:00 2001 From: Bastian de Byl Date: Sun, 26 Feb 2023 02:35:43 -0500 Subject: [PATCH] fixed Put function via revert --- helper.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/helper.go b/helper.go index 77da302..aee1df9 100644 --- a/helper.go +++ b/helper.go @@ -4,7 +4,6 @@ import ( "bytes" "encoding/json" "fmt" - "io" "net/http" ) @@ -38,7 +37,7 @@ func Get(uri string, authName string, authValue string, queries map[string]strin return response, nil } -func Post(uri string, authName string, authValue string, data io.Reader) (*http.Response, error) { +func Post(uri string, authName string, authValue string, data any) (*http.Response, error) { jsonBytes, err := json.Marshal(data) if err != nil { return nil, err @@ -64,7 +63,7 @@ func Post(uri string, authName string, authValue string, data io.Reader) (*http. return response, nil } -func Put(uri string, authName string, authValue string, data io.Reader) (*http.Response, error) { +func Put(uri string, authName string, authValue string, data any) (*http.Response, error) { jsonBytes, err := json.Marshal(data) if err != nil { return nil, err