create type D map[string]interface{}

This commit is contained in:
Pedro Pérez 2024-11-12 15:15:47 +01:00
parent 3c239f6114
commit 1fa09053ac
2 changed files with 4 additions and 1 deletions

View File

@ -27,5 +27,5 @@ func anotherHelloWorld(c *ron.Context) {
} }
func helloWorldJSON(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"})
} }

3
ron.go
View File

@ -3,9 +3,12 @@ package ron
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"log/slog"
"net/http" "net/http"
) )
type D map[string]interface{}
type Context struct { type Context struct {
C context.Context C context.Context
W http.ResponseWriter W http.ResponseWriter