From 12cefa2f311fef899e1a066bf2e4958a6ec188da Mon Sep 17 00:00:00 2001 From: RW Date: Sat, 13 Mar 2021 12:49:51 +0100 Subject: [PATCH] Prepare release - bump version --- app.go | 22 +++++++++++----------- utils/json_test.go | 21 ++++++++++++++++++++- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/app.go b/app.go index 77fdce44cf..9420191383 100644 --- a/app.go +++ b/app.go @@ -33,7 +33,7 @@ import ( ) // Version of current fiber package -const Version = "2.5.0" +const Version = "2.6.0" // Handler defines a function to serve HTTP requests. type Handler = func(*Ctx) error @@ -894,25 +894,25 @@ func (app *App) startupMessage(addr string, tls bool, pids string) { procs = "1" } - mainLogo := cBlack+ - " ┌───────────────────────────────────────────────────┐\n"+ - " │ "+centerValue(" Fiber v"+Version, 49)+" │\n" + mainLogo := cBlack + + " ┌───────────────────────────────────────────────────┐\n" + + " │ " + centerValue(" Fiber v"+Version, 49) + " │\n" if host == "0.0.0.0" { mainLogo += - " │ "+center(fmt.Sprintf("%s://127.0.0.1:%s", scheme, port), 49)+ " │\n" + - " │ "+center(fmt.Sprintf("(bound on host 0.0.0.0 and port %s)", port), 49)+ " │\n" + " │ " + center(fmt.Sprintf("%s://127.0.0.1:%s", scheme, port), 49) + " │\n" + + " │ " + center(fmt.Sprintf("(bound on host 0.0.0.0 and port %s)", port), 49) + " │\n" } else { mainLogo += - " │ "+center(fmt.Sprintf("%s://%s:%s", scheme, host, port), 49)+ " │\n" + " │ " + center(fmt.Sprintf("%s://%s:%s", scheme, host, port), 49) + " │\n" } mainLogo += fmt.Sprintf( " │ │\n"+ - " │ Handlers %s Processes %s │\n"+ - " │ Prefork .%s PID ....%s │\n"+ - " └───────────────────────────────────────────────────┘"+ - cReset, + " │ Handlers %s Processes %s │\n"+ + " │ Prefork .%s PID ....%s │\n"+ + " └───────────────────────────────────────────────────┘"+ + cReset, value(strconv.Itoa(app.handlerCount), 14), value(procs, 12), value(isPrefork, 14), value(strconv.Itoa(os.Getpid()), 14), ) diff --git a/utils/json_test.go b/utils/json_test.go index 966faa83cf..f345cca01e 100644 --- a/utils/json_test.go +++ b/utils/json_test.go @@ -1,14 +1,33 @@ package utils import ( - "encoding/json" + goJson "encoding/json" "testing" + + "github.com/gofiber/fiber/v2/internal/encoding/json" ) type sampleStructure struct { ImportantString string `json:"important_string"` } +func Test_GolangJSONEncoder(t *testing.T) { + t.Parallel() + + var ( + ss = &sampleStructure{ + ImportantString: "Hello World", + } + importantString = `{"important_string":"Hello World"}` + jsonEncoder JSONMarshal = goJson.Marshal + ) + + raw, err := jsonEncoder(ss) + AssertEqual(t, err, nil) + + AssertEqual(t, string(raw), importantString) +} + func Test_DefaultJSONEncoder(t *testing.T) { t.Parallel()