mirror of
https://gitee.com/shikong-sk/gofiber-study
synced 2025-02-23 23:32:15 +08:00
使用 goccy/go-json 替代 encoding/json
This commit is contained in:
parent
671e6a1d54
commit
16a1217025
@ -3,6 +3,7 @@ package app
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/go-redis/redis/v8"
|
"github.com/go-redis/redis/v8"
|
||||||
|
"github.com/goccy/go-json"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"gofiber.study.skcks.cn/common/config"
|
"gofiber.study.skcks.cn/common/config"
|
||||||
@ -88,6 +89,8 @@ func reloadApp(c *config.BasicConfig) *fiber.App {
|
|||||||
}
|
}
|
||||||
|
|
||||||
app := fiber.New(fiber.Config{
|
app := fiber.New(fiber.Config{
|
||||||
|
JSONEncoder: json.Marshal,
|
||||||
|
JSONDecoder: json.Unmarshal,
|
||||||
Prefork: c.Server.PreFork,
|
Prefork: c.Server.PreFork,
|
||||||
CaseSensitive: c.Server.CaseSensitive,
|
CaseSensitive: c.Server.CaseSensitive,
|
||||||
StrictRouting: c.Server.StrictRouting,
|
StrictRouting: c.Server.StrictRouting,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"github.com/goccy/go-json"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Json(data interface{}) string {
|
func Json(data interface{}) string {
|
||||||
|
Loading…
Reference in New Issue
Block a user