From 8b3d9d120003d3c048d97524283654329970da62 Mon Sep 17 00:00:00 2001 From: KeiyaYamaguchi Date: Tue, 12 Aug 2025 16:15:39 +0900 Subject: [PATCH] Modified a example code in doc.go. --- doc.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc.go b/doc.go index 87021b2..45468e5 100644 --- a/doc.go +++ b/doc.go @@ -10,14 +10,15 @@ A trivial example is: "log" "github.com/fasthttp/router" + "github.com/valyala/fasthttp" ) func Index(ctx *fasthttp.RequestCtx) { - fmt.Fprint(w, "Welcome!\n") + ctx.WriteString("Welcome!") } func Hello(ctx *fasthttp.RequestCtx) { - fmt.Fprintf(w, "hello, %s!\n", ctx.UserValue("name")) + fmt.Fprintf(ctx, "Hello, %s!\n", ctx.UserValue("name")) } func main() {