From f0cb179b8bc358d963bdb022b4a645a96e3e7d48 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Tue, 2 Apr 2024 15:23:44 +0200 Subject: [PATCH] Renamed content to send --- content/content.go => send/send.go | 2 +- content/content_test.go => send/send_test.go | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) rename content/content.go => send/send.go (98%) rename content/content_test.go => send/send_test.go (82%) diff --git a/content/content.go b/send/send.go similarity index 98% rename from content/content.go rename to send/send.go index 2eca461..79e2cf8 100644 --- a/content/content.go +++ b/send/send.go @@ -1,4 +1,4 @@ -package content +package send import ( "encoding/json" diff --git a/content/content_test.go b/send/send_test.go similarity index 82% rename from content/content_test.go rename to send/send_test.go index 5d4d2ca..4822a4e 100644 --- a/content/content_test.go +++ b/send/send_test.go @@ -1,42 +1,42 @@ -package content_test +package send_test import ( "testing" "git.akyoto.dev/go/assert" "git.akyoto.dev/go/web" - "git.akyoto.dev/go/web/content" + "git.akyoto.dev/go/web/send" ) func TestContentTypes(t *testing.T) { s := web.NewServer() s.Get("/css", func(ctx web.Context) error { - return content.CSS(ctx, "body{}") + return send.CSS(ctx, "body{}") }) s.Get("/csv", func(ctx web.Context) error { - return content.CSV(ctx, "ID;Name\n") + return send.CSV(ctx, "ID;Name\n") }) s.Get("/html", func(ctx web.Context) error { - return content.HTML(ctx, "") + return send.HTML(ctx, "") }) s.Get("/js", func(ctx web.Context) error { - return content.JS(ctx, "console.log(42)") + return send.JS(ctx, "console.log(42)") }) s.Get("/json", func(ctx web.Context) error { - return content.JSON(ctx, struct{ Name string }{Name: "User 1"}) + return send.JSON(ctx, struct{ Name string }{Name: "User 1"}) }) s.Get("/text", func(ctx web.Context) error { - return content.Text(ctx, "Hello") + return send.Text(ctx, "Hello") }) s.Get("/xml", func(ctx web.Context) error { - return content.XML(ctx, "") + return send.XML(ctx, "") }) tests := []struct {