使用 goccy/go-json 替代 encoding/json

This commit is contained in:
Shikong 2022-10-04 16:50:14 +08:00
parent 671e6a1d54
commit 16a1217025
2 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package app
import (
"context"
"github.com/go-redis/redis/v8"
"github.com/goccy/go-json"
"github.com/gofiber/fiber/v2"
"github.com/spf13/viper"
"gofiber.study.skcks.cn/common/config"
@ -88,6 +89,8 @@ func reloadApp(c *config.BasicConfig) *fiber.App {
}
app := fiber.New(fiber.Config{
JSONEncoder: json.Marshal,
JSONDecoder: json.Unmarshal,
Prefork: c.Server.PreFork,
CaseSensitive: c.Server.CaseSensitive,
StrictRouting: c.Server.StrictRouting,

View File

@ -1,7 +1,7 @@
package utils
import (
"encoding/json"
"github.com/goccy/go-json"
)
func Json(data interface{}) string {