From 625bad898b6e8628fb0fee8a0160556d314c44d6 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Wed, 20 Mar 2024 21:17:23 +0100 Subject: [PATCH] Renamed send to content --- send/send.go => content/content.go | 2 +- send/send_test.go => content/content_test.go | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) rename send/send.go => content/content.go (98%) rename send/send_test.go => content/content_test.go (85%) diff --git a/send/send.go b/content/content.go similarity index 98% rename from send/send.go rename to content/content.go index 484dbe9..2a43b2e 100644 --- a/send/send.go +++ b/content/content.go @@ -1,4 +1,4 @@ -package send +package content import ( "encoding/json" diff --git a/send/send_test.go b/content/content_test.go similarity index 85% rename from send/send_test.go rename to content/content_test.go index a6af2fc..5638f7c 100644 --- a/send/send_test.go +++ b/content/content_test.go @@ -1,4 +1,4 @@ -package send_test +package content_test import ( "io" @@ -9,38 +9,38 @@ import ( "git.akyoto.dev/go/assert" "git.akyoto.dev/go/server" - "git.akyoto.dev/go/server/send" + "git.akyoto.dev/go/server/content" ) func TestContentTypes(t *testing.T) { s := server.New() s.Get("/css", func(ctx server.Context) error { - return send.CSS(ctx, "body{}") + return content.CSS(ctx, "body{}") }) s.Get("/csv", func(ctx server.Context) error { - return send.CSV(ctx, "ID;Name\n") + return content.CSV(ctx, "ID;Name\n") }) s.Get("/html", func(ctx server.Context) error { - return send.HTML(ctx, "") + return content.HTML(ctx, "") }) s.Get("/js", func(ctx server.Context) error { - return send.JS(ctx, "console.log(42)") + return content.JS(ctx, "console.log(42)") }) s.Get("/json", func(ctx server.Context) error { - return send.JSON(ctx, struct{ Name string }{Name: "User 1"}) + return content.JSON(ctx, struct{ Name string }{Name: "User 1"}) }) s.Get("/text", func(ctx server.Context) error { - return send.Text(ctx, "Hello") + return content.Text(ctx, "Hello") }) s.Get("/xml", func(ctx server.Context) error { - return send.XML(ctx, "") + return content.XML(ctx, "") }) tests := []struct {