From 93eb26588601a31f49c1a7eb5a8177cd014e38d6 Mon Sep 17 00:00:00 2001 From: surdeus Date: Thu, 14 Dec 2023 21:59:41 +0300 Subject: [PATCH] ... --- cmd/test/main.go | 26 +++++++++++++------------- go.mod | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cmd/test/main.go b/cmd/test/main.go index f37841d..fcab9f6 100644 --- a/cmd/test/main.go +++ b/cmd/test/main.go @@ -1,25 +1,25 @@ package main import ( - "github.com/omnipunk/bond" + "github.com/di4f/bond" ) var root = bond.Mux(). -Def( - "", - bond.ApiFunc(func(c *bond.Context){ - c.W.Write([]byte("This is the index page")) - }), -).Def( + Def( + "", + bond.ApiFunc(func(c *bond.Context) { + c.W.Write([]byte("This is the index page")) + }), + ).Def( "hello", bond.Mux().Def( "en", - bond.ApiFunc(func(c *bond.Context){ + bond.ApiFunc(func(c *bond.Context) { c.W.Write([]byte("Hello, World!")) }), ).Def( "ru", - bond.ApiFunc(func(c *bond.Context){ + bond.ApiFunc(func(c *bond.Context) { c.W.Write([]byte("Привет, Мир!")) }), ), @@ -28,11 +28,11 @@ Def( bond.Static("./static"), ).Def( "test", - bond.ApiFunc(func(c *bond.Context){ + bond.ApiFunc(func(c *bond.Context) { c.SetContentType(bond.PlainText) c.Printf( - "Path: %q\n" + - "Content-Type: %q\n", + "Path: %q\n"+ + "Content-Type: %q\n", c.Path(), c.ContentType(), ) c.Printf("Query:\n") @@ -47,7 +47,7 @@ Def( func main() { srv := bond.Server{ - Addr: ":10800", + Addr: ":10800", Handler: root, } err := srv.ListenAndServe() diff --git a/go.mod b/go.mod index 20a078e..b293647 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/omnipunk/bond +module github.com/di4f/bond go 1.21.3