From 1fa09053ac5de8386c57ed205df4caaf77365dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20P=C3=A9rez?= Date: Tue, 12 Nov 2024 15:15:47 +0100 Subject: [PATCH] create type D map[string]interface{} --- example/main.go | 2 +- ron.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/example/main.go b/example/main.go index 1dc3df1..03cf272 100644 --- a/example/main.go +++ b/example/main.go @@ -27,5 +27,5 @@ func anotherHelloWorld(c *ron.Context) { } func helloWorldJSON(c *ron.Context) { - c.JSON(200, map[string]string{"message": "hello world"}) + c.JSON(200, ron.D{"message": "hello world"}) } diff --git a/ron.go b/ron.go index a779631..a5281af 100644 --- a/ron.go +++ b/ron.go @@ -3,9 +3,12 @@ package ron import ( "context" "encoding/json" + "log/slog" "net/http" ) +type D map[string]interface{} + type Context struct { C context.Context W http.ResponseWriter