Skip to content

Commit

Permalink
Prepare release
Browse files Browse the repository at this point in the history
- bump version
  • Loading branch information
ReneWerner87 authored Mar 13, 2021
1 parent f3163a2 commit 12cefa2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
22 changes: 11 additions & 11 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
)
Expand Down
21 changes: 20 additions & 1 deletion utils/json_test.go
Original file line number Diff line number Diff line change
@@ -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()

Expand Down

0 comments on commit 12cefa2

Please sign in to comment.