Initial commit

This commit is contained in:
user
2026-07-12 13:47:34 +04:00
commit 51e2e789d0
37 changed files with 2005 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
package marshaling
import (
"encoding/json"
"go_project/pkg/behaivor"
"io"
"net/http"
)
// NOTE: Not used in this project
func MustUnmarshalBody(r *http.Request, x interface{}) {
body, err := io.ReadAll(r.Body)
behaivor.Anxiety("Error reading the request body", err)
err = json.Unmarshal([]byte(body), x)
behaivor.Anxiety("Error unmarshaling the request body", err)
}