From a8dfad1355f51d9b68a86017a4dd9af05d224934 Mon Sep 17 00:00:00 2001 From: Skyenought <1808644906@qq.com> Date: Mon, 28 Aug 2023 18:50:50 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=F0=9F=A9=B9=20(fiberi18n):=20Fix=20reque?= =?UTF-8?q?st=20concurrency=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fiberi18n/README.md | 36 ++++++++++++++++++++---------------- fiberi18n/config.go | 5 ++++- fiberi18n/embed_test.go | 5 +++-- fiberi18n/example/main.go | 4 ++-- fiberi18n/i18n.go | 34 ++++++++++++++++++---------------- fiberi18n/i18n_test.go | 5 +++-- 6 files changed, 50 insertions(+), 39 deletions(-) diff --git a/fiberi18n/README.md b/fiberi18n/README.md index f5418428..3ae53268 100644 --- a/fiberi18n/README.md +++ b/fiberi18n/README.md @@ -25,22 +25,24 @@ go get -u github.com/gofiber/contrib/fiberi18n ## Signature -``` -fiberi18n.New(config ...*fiberi18n.Config) fiber.Handler -``` +| Name | Signature | Description | +|--------------|--------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------| +| New | `New(config ...*fiberi18n.Config) fiber.Handler` | Create a new fiberi18n middleware handler | +| Localize | `Localize(ctx *fiber.Ctx, params interface{}) (string, error)` | Localize returns a localized message. param is one of these type: messageID, *i18n.LocalizeConfig | +| MustLocalize | `MustLocalize(ctx *fiber.Ctx, params interface{}) (string, error)` | MustLocalize is similar to Localize, except it panics if an error happens. param is one of these type: messageID, *i18n.LocalizeConfig | ## Config -| Property | Type | Description | Default | -| ---------------- | ------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| Next | `func(c *fiber.Ctx) bool` | A function to skip this middleware when returned `true`. | `nil` | -| RootPath | `string` | The i18n template folder path. | `"./example/localize"` | -| AcceptLanguages | `[]language.Tag` | A collection of languages that can be processed. | `[]language.Tag{language.Chinese, language.English}` | -| FormatBundleFile | `string` | The type of the template file. | `"yaml"` | -| DefaultLanguage | `language.Tag` | The default returned language type. | `language.English` | -| Loader | `Loader` | The implementation of the Loader interface, which defines how to read the file. We provide both os.ReadFile and embed.FS.ReadFile. | `LoaderFunc(os.ReadFile)` | -| UnmarshalFunc | `i18n.UnmarshalFunc` | The function used for decoding template files. | `yaml.Unmarshal` | -| LangHandler | `func(ctx *fiber.Ctx, defaultLang string) string` | Used to get the kind of language handled by *fiber.Ctx and defaultLang. | Retrieved from the request header `Accept-Language` or query parameter `lang`. | +| Property | Type | Description | Default | +|------------------|---------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------| +| Next | `func(c *fiber.Ctx) bool` | A function to skip this middleware when returned `true`. | `nil` | +| RootPath | `string` | The i18n template folder path. | `"./example/localize"` | +| AcceptLanguages | `[]language.Tag` | A collection of languages that can be processed. | `[]language.Tag{language.Chinese, language.English}` | +| FormatBundleFile | `string` | The type of the template file. | `"yaml"` | +| DefaultLanguage | `language.Tag` | The default returned language type. | `language.English` | +| Loader | `Loader` | The implementation of the Loader interface, which defines how to read the file. We provide both os.ReadFile and embed.FS.ReadFile. | `LoaderFunc(os.ReadFile)` | +| UnmarshalFunc | `i18n.UnmarshalFunc` | The function used for decoding template files. | `yaml.Unmarshal` | +| LangHandler | `func(ctx *fiber.Ctx, defaultLang string) string` | Used to get the kind of language handled by *fiber.Ctx and defaultLang. | Retrieved from the request header `Accept-Language` or query parameter `lang`. | ## Example @@ -48,6 +50,8 @@ fiberi18n.New(config ...*fiberi18n.Config) fiber.Handler package main import ( + "log" + "github.com/gofiber/contrib/fiberi18n" "github.com/gofiber/fiber/v2" "github.com/nicksnyder/go-i18n/v2/i18n" @@ -64,17 +68,17 @@ func main() { }), ) app.Get("/", func(c *fiber.Ctx) error { - return c.SendString(fiberi18n.MustGetMessage("welcome")) + return c.SendString(fiberi18n.MustLocalize(c, "welcome")) }) app.Get("/:name", func(ctx *fiber.Ctx) error { - return ctx.SendString(fiberi18n.MustGetMessage(&i18n.LocalizeConfig{ + return ctx.SendString(fiberi18n.MustLocalize(ctx, &i18n.LocalizeConfig{ MessageID: "welcomeWithName", TemplateData: map[string]string{ "name": ctx.Params("name"), }, })) }) - app.Listen("127.0.0.1:3000") + log.Fatal(app.Listen(":3000")) } ``` diff --git a/fiberi18n/config.go b/fiberi18n/config.go index 247270c7..d1afad6c 100644 --- a/fiberi18n/config.go +++ b/fiberi18n/config.go @@ -52,7 +52,6 @@ type Config struct { // Optional. Default: The language type is retrieved from the request header: `Accept-Language` or query param : `lang` LangHandler func(ctx *fiber.Ctx, defaultLang string) string - ctx *fiber.Ctx bundle *i18n.Bundle localizerMap *sync.Map } @@ -68,6 +67,7 @@ func (f LoaderFunc) LoadMessage(path string) ([]byte, error) { } var ConfigDefault = &Config{ + Next: nil, RootPath: "./example/localize", DefaultLanguage: language.English, AcceptLanguages: []language.Tag{language.Chinese, language.English}, @@ -78,6 +78,9 @@ var ConfigDefault = &Config{ } func defaultLangHandler(c *fiber.Ctx, defaultLang string) string { + if c == nil || c.Request() == nil { + return defaultLang + } var lang string lang = utils.CopyString(c.Query("lang")) if lang != "" { diff --git a/fiberi18n/embed_test.go b/fiberi18n/embed_test.go index 7e8bec4c..384cb12f 100644 --- a/fiberi18n/embed_test.go +++ b/fiberi18n/embed_test.go @@ -26,10 +26,10 @@ func newEmbedServer() *fiber.App { FormatBundleFile: "json", })) app.Get("/", func(ctx *fiber.Ctx) error { - return ctx.SendString(MustGetMessage("welcome")) + return ctx.SendString(MustLocalize(ctx, "welcome")) }) app.Get("/:name", func(ctx *fiber.Ctx) error { - return ctx.SendString(MustGetMessage(&i18n.LocalizeConfig{ + return ctx.SendString(MustLocalize(ctx, &i18n.LocalizeConfig{ MessageID: "welcomeWithName", TemplateData: map[string]string{ "name": ctx.Params("name"), @@ -52,6 +52,7 @@ func request(lang language.Tag, name string) (*http.Response, error) { } func TestEmbedLoader_LoadMessage(t *testing.T) { + t.Parallel() type args struct { lang language.Tag name string diff --git a/fiberi18n/example/main.go b/fiberi18n/example/main.go index 576d3312..750d2590 100644 --- a/fiberi18n/example/main.go +++ b/fiberi18n/example/main.go @@ -19,10 +19,10 @@ func main() { }), ) app.Get("/", func(c *fiber.Ctx) error { - return c.SendString(fiberi18n.MustGetMessage("welcome")) + return c.SendString(fiberi18n.MustLocalize(c, "welcome")) }) app.Get("/:name", func(ctx *fiber.Ctx) error { - return ctx.SendString(fiberi18n.MustGetMessage(&i18n.LocalizeConfig{ + return ctx.SendString(fiberi18n.MustLocalize(ctx, &i18n.LocalizeConfig{ MessageID: "welcomeWithName", TemplateData: map[string]string{ "name": ctx.Params("name"), diff --git a/fiberi18n/i18n.go b/fiberi18n/i18n.go index 9be5d530..a88e0572 100644 --- a/fiberi18n/i18n.go +++ b/fiberi18n/i18n.go @@ -2,6 +2,7 @@ package fiberi18n import ( "fmt" + "github.com/gofiber/fiber/v2/log" "path" "sync" @@ -9,11 +10,9 @@ import ( "github.com/nicksnyder/go-i18n/v2/i18n" ) -var appCfg *Config - // New creates a new middleware handler func New(config ...*Config) fiber.Handler { - appCfg = configDefault(config...) + appCfg := configDefault(config...) // init bundle bundle := i18n.NewBundle(appCfg.DefaultLanguage) bundle.RegisterUnmarshalFunc(appCfg.FormatBundleFile, appCfg.UnmarshalFunc) @@ -25,9 +24,7 @@ func New(config ...*Config) fiber.Handler { if appCfg.Next != nil && appCfg.Next(c) { return c.Next() } - - appCfg.ctx = c - + c.Locals("fiberi18n", appCfg) return c.Next() } } @@ -67,38 +64,42 @@ func (c *Config) initLocalizerMap() { } /* -MustGetMessage get the i18n message without error handling +MustLocalize get the i18n message without error handling param is one of these type: messageID, *i18n.LocalizeConfig Example: - MustGetMessage("hello") // messageID is hello - MustGetMessage(&i18n.LocalizeConfig{ + MustLocalize(ctx, "hello") // messageID is hello + MustLocalize(ctx, &i18n.LocalizeConfig{ MessageID: "welcomeWithName", TemplateData: map[string]string{ "name": context.Param("name"), }, }) */ -func MustGetMessage(params interface{}) string { - message, _ := GetMessage(params) +func MustLocalize(ctx *fiber.Ctx, params interface{}) string { + message, err := Localize(ctx, params) + if err != nil { + panic(err) + } return message } /* -GetMessage get the i18n message +Localize get the i18n message param is one of these type: messageID, *i18n.LocalizeConfig Example: - GetMessage("hello") // messageID is hello - GetMessage(&i18n.LocalizeConfig{ + Localize(ctx, "hello") // messageID is hello + Localize(ctx, &i18n.LocalizeConfig{ MessageID: "welcomeWithName", TemplateData: map[string]string{ "name": context.Param("name"), }, }) */ -func GetMessage(params interface{}) (string, error) { - lang := appCfg.LangHandler(appCfg.ctx, appCfg.DefaultLanguage.String()) +func Localize(ctx *fiber.Ctx, params interface{}) (string, error) { + appCfg := ctx.Locals("fiberi18n").(*Config) + lang := appCfg.LangHandler(ctx, appCfg.DefaultLanguage.String()) localizer, _ := appCfg.localizerMap.Load(lang) if localizer == nil { @@ -116,6 +117,7 @@ func GetMessage(params interface{}) (string, error) { message, err := localizer.(*i18n.Localizer).Localize(localizeConfig) if err != nil { + log.Errorf("i18n.Localize error: %v", err) return "", fmt.Errorf("i18n.Localize error: %v", err) } return message, nil diff --git a/fiberi18n/i18n_test.go b/fiberi18n/i18n_test.go index ca442bdf..ab12b393 100644 --- a/fiberi18n/i18n_test.go +++ b/fiberi18n/i18n_test.go @@ -16,10 +16,10 @@ func newServer() *fiber.App { app := fiber.New() app.Use(New()) app.Get("/", func(ctx *fiber.Ctx) error { - return ctx.SendString(MustGetMessage("welcome")) + return ctx.SendString(MustLocalize(ctx, "welcome")) }) app.Get("/:name", func(ctx *fiber.Ctx) error { - return ctx.SendString(MustGetMessage(&i18n.LocalizeConfig{ + return ctx.SendString(MustLocalize(ctx, &i18n.LocalizeConfig{ MessageID: "welcomeWithName", TemplateData: map[string]string{ "name": ctx.Params("name"), @@ -42,6 +42,7 @@ func makeRequest(lang language.Tag, name string) (*http.Response, error) { } func TestI18nEN(t *testing.T) { + t.Parallel() type args struct { lang language.Tag name string From 1d2dfb8ce3dfacc22f7c07645b301a0de435a454 Mon Sep 17 00:00:00 2001 From: Skyenought Date: Tue, 29 Aug 2023 15:53:33 +0800 Subject: [PATCH 02/16] update to v2 --- .github/workflows/test-fiberi18n.yml | 4 +- fiberi18n/README.md | 10 ++- fiberi18n/example/main.go | 8 ++- fiberi18n/go.mod | 4 +- fiberi18n/i18n_test.go | 97 ++++++++++++++++++++++++++-- 5 files changed, 108 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test-fiberi18n.yml b/.github/workflows/test-fiberi18n.yml index d50189f7..3d4a77cb 100644 --- a/.github/workflows/test-fiberi18n.yml +++ b/.github/workflows/test-fiberi18n.yml @@ -17,9 +17,9 @@ jobs: strategy: matrix: go-version: - - 1.18.x - 1.19.x - 1.20.x + - 1.21.x steps: - name: Fetch Repository uses: actions/checkout@v3 @@ -29,4 +29,4 @@ jobs: go-version: '${{ matrix.go-version }}' - name: Run Test working-directory: ./fiberi18n - run: go test -v -race ./... \ No newline at end of file + run: go test -v -race ./... diff --git a/fiberi18n/README.md b/fiberi18n/README.md index 3ae53268..da4404f8 100644 --- a/fiberi18n/README.md +++ b/fiberi18n/README.md @@ -20,7 +20,7 @@ This middleware supports Fiber v2. ``` go get -u github.com/gofiber/fiber/v2 -go get -u github.com/gofiber/contrib/fiberi18n +go get -u github.com/gofiber/contrib/fiberi18n/v2 ``` ## Signature @@ -52,7 +52,7 @@ package main import ( "log" - "github.com/gofiber/contrib/fiberi18n" + "github.com/gofiber/contrib/fiberi18n/v2" "github.com/gofiber/fiber/v2" "github.com/nicksnyder/go-i18n/v2/i18n" "golang.org/x/text/language" @@ -68,7 +68,11 @@ func main() { }), ) app.Get("/", func(c *fiber.Ctx) error { - return c.SendString(fiberi18n.MustLocalize(c, "welcome")) + localize, err := fiberi18n.Localize(c, "welcome") + if err != nil { + return c.Status(fiber.StatusInternalServerError).SendString(err.Error()) + } + return c.SendString(localize) }) app.Get("/:name", func(ctx *fiber.Ctx) error { return ctx.SendString(fiberi18n.MustLocalize(ctx, &i18n.LocalizeConfig{ diff --git a/fiberi18n/example/main.go b/fiberi18n/example/main.go index 750d2590..5f07e7ef 100644 --- a/fiberi18n/example/main.go +++ b/fiberi18n/example/main.go @@ -3,7 +3,7 @@ package main import ( "log" - "github.com/gofiber/contrib/fiberi18n" + "github.com/gofiber/contrib/fiberi18n/v2" "github.com/gofiber/fiber/v2" "github.com/nicksnyder/go-i18n/v2/i18n" "golang.org/x/text/language" @@ -19,7 +19,11 @@ func main() { }), ) app.Get("/", func(c *fiber.Ctx) error { - return c.SendString(fiberi18n.MustLocalize(c, "welcome")) + localize, err := fiberi18n.Localize(c, "welcome") + if err != nil { + return c.Status(fiber.StatusInternalServerError).SendString(err.Error()) + } + return c.SendString(localize) }) app.Get("/:name", func(ctx *fiber.Ctx) error { return ctx.SendString(fiberi18n.MustLocalize(ctx, &i18n.LocalizeConfig{ diff --git a/fiberi18n/go.mod b/fiberi18n/go.mod index 172de554..569077cf 100644 --- a/fiberi18n/go.mod +++ b/fiberi18n/go.mod @@ -1,6 +1,6 @@ -module github.com/gofiber/contrib/fiberi18n +module github.com/gofiber/contrib/fiberi18n/v2 -go 1.18 +go 1.19 require ( github.com/gofiber/fiber/v2 v2.49.0 diff --git a/fiberi18n/i18n_test.go b/fiberi18n/i18n_test.go index ab12b393..098297ac 100644 --- a/fiberi18n/i18n_test.go +++ b/fiberi18n/i18n_test.go @@ -4,6 +4,7 @@ import ( "context" "io" "net/http" + "sync" "testing" "github.com/gofiber/fiber/v2" @@ -31,13 +32,15 @@ func newServer() *fiber.App { var i18nApp = newServer() -func makeRequest(lang language.Tag, name string) (*http.Response, error) { +func makeRequest(lang language.Tag, name string, app *fiber.App) (*http.Response, error) { path := "/" + name req, _ := http.NewRequestWithContext(context.Background(), "GET", path, nil) - req.Header.Add("Accept-Language", lang.String()) + if lang != language.Und { + req.Header.Add("Accept-Language", lang.String()) + } req.Method = "GET" req.RequestURI = path - resp, err := i18nApp.Test(req) + resp, err := app.Test(req) return resp, err } @@ -71,7 +74,7 @@ func TestI18nEN(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := makeRequest(tt.args.lang, tt.args.name) + got, err := makeRequest(tt.args.lang, tt.args.name, i18nApp) utils.AssertEqual(t, err, nil) body, err := io.ReadAll(got.Body) utils.AssertEqual(t, err, nil) @@ -109,7 +112,7 @@ func TestI18nZH(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := makeRequest(tt.args.lang, tt.args.name) + got, err := makeRequest(tt.args.lang, tt.args.name, i18nApp) utils.AssertEqual(t, err, nil) body, err := io.ReadAll(got.Body) utils.AssertEqual(t, err, nil) @@ -156,7 +159,7 @@ func TestParallelI18n(t *testing.T) { t.Parallel() for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := makeRequest(tt.args.lang, tt.args.name) + got, err := makeRequest(tt.args.lang, tt.args.name, i18nApp) utils.AssertEqual(t, err, nil) body, err := io.ReadAll(got.Body) utils.AssertEqual(t, err, nil) @@ -164,3 +167,85 @@ func TestParallelI18n(t *testing.T) { }) } } + +func TestLocalize(t *testing.T) { + t.Parallel() + app := fiber.New() + app.Use(New()) + app.Get("/", func(ctx *fiber.Ctx) error { + localize, err := Localize(ctx, "welcome?") + utils.AssertEqual(t, "", localize) + return fiber.NewError(500, err.Error()) + }) + + app.Get("/:name", func(ctx *fiber.Ctx) error { + name := ctx.Params("name") + localize, err := Localize(ctx, &i18n.LocalizeConfig{ + MessageID: "welcomeWithName", + TemplateData: map[string]string{ + "name": name, + }, + }) + utils.AssertEqual(t, nil, err) + return ctx.SendString(localize) + }) + + t.Run("test localize", func(t *testing.T) { + got, err := makeRequest(language.Chinese, "", app) + utils.AssertEqual(t, 500, got.StatusCode) + utils.AssertEqual(t, nil, err) + body, _ := io.ReadAll(got.Body) + utils.AssertEqual(t, `i18n.Localize error: message "welcome?" not found in language "zh"`, string(body)) + + got, err = makeRequest(language.English, "name", app) + utils.AssertEqual(t, 200, got.StatusCode) + utils.AssertEqual(t, nil, err) + body, _ = io.ReadAll(got.Body) + utils.AssertEqual(t, "hello name", string(body)) + }) +} + +func Test_defaultLangHandler(t *testing.T) { + t.Parallel() + app := fiber.New() + app.Use(New()) + app.Get("/", func(c *fiber.Ctx) error { + return c.SendString(defaultLangHandler(nil, language.English.String())) + }) + app.Get("/test", func(c *fiber.Ctx) error { + return c.SendString(defaultLangHandler(c, language.English.String())) + }) + + t.Run("test nil ctx", func(t *testing.T) { + var wg sync.WaitGroup + want := 100 + wg.Add(want) + for i := 0; i < want; i++ { + go func() { + defer wg.Done() + got, err := makeRequest(language.English, "", app) + utils.AssertEqual(t, nil, err) + body, _ := io.ReadAll(got.Body) + utils.AssertEqual(t, "en", string(body)) + }() + } + wg.Wait() + }) + + t.Run("test query and header", func(t *testing.T) { + got, err := makeRequest(language.Chinese, "test?lang=en", app) + utils.AssertEqual(t, nil, err) + body, _ := io.ReadAll(got.Body) + utils.AssertEqual(t, "en", string(body)) + + got, err = makeRequest(language.Chinese, "test", app) + utils.AssertEqual(t, nil, err) + body, _ = io.ReadAll(got.Body) + utils.AssertEqual(t, "zh", string(body)) + + got, err = makeRequest(language.Chinese, "test", app) + utils.AssertEqual(t, nil, err) + body, _ = io.ReadAll(got.Body) + utils.AssertEqual(t, "zh", string(body)) + }) +} From f3bf93168c5ed0868ec144f4446f1639f5ef27d5 Mon Sep 17 00:00:00 2001 From: Skyenought Date: Wed, 30 Aug 2023 00:30:00 +0800 Subject: [PATCH 03/16] remove change for .github --- fiberi18n/config.go | 1 + fiberi18n/i18n.go | 28 ++++++++++++++++++++-------- fiberi18n/i18n_test.go | 3 +-- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/fiberi18n/config.go b/fiberi18n/config.go index d1afad6c..52030741 100644 --- a/fiberi18n/config.go +++ b/fiberi18n/config.go @@ -54,6 +54,7 @@ type Config struct { bundle *i18n.Bundle localizerMap *sync.Map + mu sync.Mutex } type Loader interface { diff --git a/fiberi18n/i18n.go b/fiberi18n/i18n.go index a88e0572..da05a435 100644 --- a/fiberi18n/i18n.go +++ b/fiberi18n/i18n.go @@ -12,19 +12,20 @@ import ( // New creates a new middleware handler func New(config ...*Config) fiber.Handler { - appCfg := configDefault(config...) + cfg := configDefault(config...) // init bundle - bundle := i18n.NewBundle(appCfg.DefaultLanguage) - bundle.RegisterUnmarshalFunc(appCfg.FormatBundleFile, appCfg.UnmarshalFunc) - appCfg.bundle = bundle + bundle := i18n.NewBundle(cfg.DefaultLanguage) + bundle.RegisterUnmarshalFunc(cfg.FormatBundleFile, cfg.UnmarshalFunc) + cfg.bundle = bundle - appCfg.loadMessages().initLocalizerMap() + cfg.loadMessages() + cfg.initLocalizerMap() return func(c *fiber.Ctx) error { - if appCfg.Next != nil && appCfg.Next(c) { + if cfg.Next != nil && cfg.Next(c) { return c.Next() } - c.Locals("fiberi18n", appCfg) + c.Locals("fiberi18n", cfg) return c.Next() } } @@ -40,6 +41,8 @@ func (c *Config) loadMessage(filepath string) { } func (c *Config) loadMessages() *Config { + c.mu.Lock() + defer c.mu.Unlock() for _, lang := range c.AcceptLanguages { bundleFilePath := fmt.Sprintf("%s.%s", lang.String(), c.FormatBundleFile) filepath := path.Join(c.RootPath, bundleFilePath) @@ -60,7 +63,16 @@ func (c *Config) initLocalizerMap() { if _, ok := localizerMap.Load(lang); !ok { localizerMap.Store(lang, i18n.NewLocalizer(c.bundle, lang)) } - c.localizerMap = localizerMap + c.mu.Lock() + + newLocalizerMap := &sync.Map{} + localizerMap.Range(func(key, value interface{}) bool { + newLocalizerMap.Store(key, value) + return true + }) + + c.localizerMap = newLocalizerMap + c.mu.Unlock() } /* diff --git a/fiberi18n/i18n_test.go b/fiberi18n/i18n_test.go index 098297ac..de79098f 100644 --- a/fiberi18n/i18n_test.go +++ b/fiberi18n/i18n_test.go @@ -206,7 +206,6 @@ func TestLocalize(t *testing.T) { } func Test_defaultLangHandler(t *testing.T) { - t.Parallel() app := fiber.New() app.Use(New()) app.Get("/", func(c *fiber.Ctx) error { @@ -215,7 +214,7 @@ func Test_defaultLangHandler(t *testing.T) { app.Get("/test", func(c *fiber.Ctx) error { return c.SendString(defaultLangHandler(c, language.English.String())) }) - + t.Parallel() t.Run("test nil ctx", func(t *testing.T) { var wg sync.WaitGroup want := 100 From 0eb2807e0f1c36b43c19ce0a943fc020ab86a540 Mon Sep 17 00:00:00 2001 From: Skyenought Date: Sun, 3 Sep 2023 10:47:04 +0800 Subject: [PATCH 04/16] upgraded github.com/gofiber/fiber/v2 --- fiberi18n/go.mod | 10 +++++----- fiberi18n/go.sum | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/fiberi18n/go.mod b/fiberi18n/go.mod index 569077cf..dcfea1ac 100644 --- a/fiberi18n/go.mod +++ b/fiberi18n/go.mod @@ -3,9 +3,9 @@ module github.com/gofiber/contrib/fiberi18n/v2 go 1.19 require ( - github.com/gofiber/fiber/v2 v2.49.0 + github.com/gofiber/fiber/v2 v2.49.1 github.com/nicksnyder/go-i18n/v2 v2.2.1 - golang.org/x/text v0.12.0 + golang.org/x/text v0.13.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -16,9 +16,9 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.48.0 // indirect + github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect ) diff --git a/fiberi18n/go.sum b/fiberi18n/go.sum index ac8caef0..96cb3cd3 100644 --- a/fiberi18n/go.sum +++ b/fiberi18n/go.sum @@ -2,8 +2,8 @@ github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= -github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= +github.com/gofiber/fiber/v2 v2.49.1 h1:0W2DRWevSirc8pJl4o8r8QejDR8TV6ZUCawHxwbIdOk= +github.com/gofiber/fiber/v2 v2.49.1/go.mod h1:nPUeEBUeeYGgwbDm59Gp7vS8MDyScL6ezr/Np9A13WU= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= @@ -17,12 +17,13 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/nicksnyder/go-i18n/v2 v2.2.1 h1:aOzRCdwsJuoExfZhoiXHy4bjruwCMdt5otbYojM/PaA= github.com/nicksnyder/go-i18n/v2 v2.2.1/go.mod h1:fF2++lPHlo+/kPaj3nB0uxtPwzlPm+BlgwGX7MkeGj0= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.48.0 h1:oJWvHb9BIZToTQS3MuQ2R3bJZiNSa2KiNdeI8A+79Tc= -github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= +github.com/valyala/fasthttp v1.49.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -41,16 +42,16 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 55911c3081cf63419a3f6952686a7c27a86d89a3 Mon Sep 17 00:00:00 2001 From: Skyenought Date: Sun, 3 Sep 2023 11:16:12 +0800 Subject: [PATCH 05/16] upgraded github.com/gofiber/fiber/v2 --- casbin/go.mod | 4 ++-- casbin/go.sum | 8 ++++---- fiberi18n/i18n.go | 3 +-- fibernewrelic/go.mod | 4 ++-- fibernewrelic/go.sum | 8 ++++---- fiberzap/go.mod | 2 +- fiberzap/go.sum | 4 ++-- fiberzerolog/go.mod | 8 ++++---- fiberzerolog/go.sum | 15 ++++++++------- jwt/go.mod | 8 ++++---- jwt/go.sum | 15 ++++++++------- opafiber/go.mod | 8 ++++---- opafiber/go.sum | 15 ++++++++------- otelfiber/example/go.mod | 8 ++++---- otelfiber/example/go.sum | 16 ++++++++-------- otelfiber/go.mod | 8 ++++---- otelfiber/go.sum | 15 ++++++++------- paseto/go.mod | 4 ++-- paseto/go.sum | 8 ++++---- swagger/go.mod | 6 +++--- swagger/go.sum | 11 ++++++----- websocket/go.mod | 6 +++--- websocket/go.sum | 11 ++++++----- 23 files changed, 100 insertions(+), 95 deletions(-) diff --git a/casbin/go.mod b/casbin/go.mod index d0b9f69c..b76ec5da 100644 --- a/casbin/go.mod +++ b/casbin/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/casbin/casbin/v2 v2.77.1 - github.com/gofiber/fiber/v2 v2.49.0 + github.com/gofiber/fiber/v2 v2.49.1 ) require ( @@ -20,7 +20,7 @@ require ( github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.48.0 // indirect + github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect golang.org/x/sys v0.11.0 // indirect ) diff --git a/casbin/go.sum b/casbin/go.sum index 6a60233a..04d4d6f5 100644 --- a/casbin/go.sum +++ b/casbin/go.sum @@ -4,8 +4,8 @@ github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/ github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/casbin/casbin/v2 v2.77.1 h1:+H46VamJCTlmCPcb0N99Zaj4tSorfuvBh3v5lyGopeU= github.com/casbin/casbin/v2 v2.77.1/go.mod h1:mzGx0hYW9/ksOSpw3wNjk3NRAroq5VMFYUQ6G43iGPk= -github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= -github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= +github.com/gofiber/fiber/v2 v2.49.1 h1:0W2DRWevSirc8pJl4o8r8QejDR8TV6ZUCawHxwbIdOk= +github.com/gofiber/fiber/v2 v2.49.1/go.mod h1:nPUeEBUeeYGgwbDm59Gp7vS8MDyScL6ezr/Np9A13WU= github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= @@ -29,8 +29,8 @@ github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.48.0 h1:oJWvHb9BIZToTQS3MuQ2R3bJZiNSa2KiNdeI8A+79Tc= -github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= +github.com/valyala/fasthttp v1.49.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/fiberi18n/i18n.go b/fiberi18n/i18n.go index da05a435..56ee0cdd 100644 --- a/fiberi18n/i18n.go +++ b/fiberi18n/i18n.go @@ -64,7 +64,7 @@ func (c *Config) initLocalizerMap() { localizerMap.Store(lang, i18n.NewLocalizer(c.bundle, lang)) } c.mu.Lock() - + defer c.mu.Unlock() newLocalizerMap := &sync.Map{} localizerMap.Range(func(key, value interface{}) bool { newLocalizerMap.Store(key, value) @@ -72,7 +72,6 @@ func (c *Config) initLocalizerMap() { }) c.localizerMap = newLocalizerMap - c.mu.Unlock() } /* diff --git a/fibernewrelic/go.mod b/fibernewrelic/go.mod index e961e62c..f5781b25 100644 --- a/fibernewrelic/go.mod +++ b/fibernewrelic/go.mod @@ -3,7 +3,7 @@ module github.com/gofiber/contrib/fibernewrelic go 1.18 require ( - github.com/gofiber/fiber/v2 v2.49.0 + github.com/gofiber/fiber/v2 v2.49.1 github.com/newrelic/go-agent/v3 v3.24.1 github.com/stretchr/testify v1.8.4 ) @@ -20,7 +20,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.48.0 // indirect + github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect golang.org/x/net v0.8.0 // indirect golang.org/x/sys v0.11.0 // indirect diff --git a/fibernewrelic/go.sum b/fibernewrelic/go.sum index 55fce166..b2d9fa55 100644 --- a/fibernewrelic/go.sum +++ b/fibernewrelic/go.sum @@ -2,8 +2,8 @@ github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/ github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= -github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= +github.com/gofiber/fiber/v2 v2.49.1 h1:0W2DRWevSirc8pJl4o8r8QejDR8TV6ZUCawHxwbIdOk= +github.com/gofiber/fiber/v2 v2.49.1/go.mod h1:nPUeEBUeeYGgwbDm59Gp7vS8MDyScL6ezr/Np9A13WU= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -30,8 +30,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.48.0 h1:oJWvHb9BIZToTQS3MuQ2R3bJZiNSa2KiNdeI8A+79Tc= -github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= +github.com/valyala/fasthttp v1.49.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= diff --git a/fiberzap/go.mod b/fiberzap/go.mod index 7c5e00e1..25bb7546 100644 --- a/fiberzap/go.mod +++ b/fiberzap/go.mod @@ -3,7 +3,7 @@ module github.com/gofiber/contrib/fiberzap/v2 go 1.19 require ( - github.com/gofiber/fiber/v2 v2.49.0 + github.com/gofiber/fiber/v2 v2.49.1 github.com/stretchr/testify v1.8.4 github.com/valyala/fasthttp v1.49.0 go.uber.org/zap v1.25.0 diff --git a/fiberzap/go.sum b/fiberzap/go.sum index f26d3df6..94d47edb 100644 --- a/fiberzap/go.sum +++ b/fiberzap/go.sum @@ -3,8 +3,8 @@ github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHG github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= -github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= +github.com/gofiber/fiber/v2 v2.49.1 h1:0W2DRWevSirc8pJl4o8r8QejDR8TV6ZUCawHxwbIdOk= +github.com/gofiber/fiber/v2 v2.49.1/go.mod h1:nPUeEBUeeYGgwbDm59Gp7vS8MDyScL6ezr/Np9A13WU= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= diff --git a/fiberzerolog/go.mod b/fiberzerolog/go.mod index 5ac1915b..5a74411b 100644 --- a/fiberzerolog/go.mod +++ b/fiberzerolog/go.mod @@ -3,7 +3,7 @@ module github.com/gofiber/contrib/fiberzerolog go 1.18 require ( - github.com/gofiber/fiber/v2 v2.49.0 + github.com/gofiber/fiber/v2 v2.49.1 github.com/rs/zerolog v1.30.0 ) @@ -14,9 +14,9 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.48.0 // indirect + github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect ) diff --git a/fiberzerolog/go.sum b/fiberzerolog/go.sum index 402afd1f..4e16f79c 100644 --- a/fiberzerolog/go.sum +++ b/fiberzerolog/go.sum @@ -2,8 +2,8 @@ github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/ github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= -github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= +github.com/gofiber/fiber/v2 v2.49.1 h1:0W2DRWevSirc8pJl4o8r8QejDR8TV6ZUCawHxwbIdOk= +github.com/gofiber/fiber/v2 v2.49.1/go.mod h1:nPUeEBUeeYGgwbDm59Gp7vS8MDyScL6ezr/Np9A13WU= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= @@ -18,20 +18,21 @@ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c= github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.48.0 h1:oJWvHb9BIZToTQS3MuQ2R3bJZiNSa2KiNdeI8A+79Tc= -github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= +github.com/valyala/fasthttp v1.49.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/jwt/go.mod b/jwt/go.mod index 4f2df900..1b8bcdfc 100644 --- a/jwt/go.mod +++ b/jwt/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/MicahParks/keyfunc/v2 v2.1.0 - github.com/gofiber/fiber/v2 v2.49.0 + github.com/gofiber/fiber/v2 v2.49.1 github.com/golang-jwt/jwt/v5 v5.0.0 ) @@ -15,9 +15,9 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.48.0 // indirect + github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect ) diff --git a/jwt/go.sum b/jwt/go.sum index 08f918a1..92f0a52c 100644 --- a/jwt/go.sum +++ b/jwt/go.sum @@ -2,8 +2,8 @@ github.com/MicahParks/keyfunc/v2 v2.1.0 h1:6ZXKb9Rp6qp1bDbJefnG7cTH8yMN1IC/4nf+G github.com/MicahParks/keyfunc/v2 v2.1.0/go.mod h1:rW42fi+xgLJ2FRRXAfNx9ZA8WpD4OeE/yHVMteCkw9k= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= -github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= +github.com/gofiber/fiber/v2 v2.49.1 h1:0W2DRWevSirc8pJl4o8r8QejDR8TV6ZUCawHxwbIdOk= +github.com/gofiber/fiber/v2 v2.49.1/go.mod h1:nPUeEBUeeYGgwbDm59Gp7vS8MDyScL6ezr/Np9A13WU= github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= @@ -17,15 +17,16 @@ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APP github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.48.0 h1:oJWvHb9BIZToTQS3MuQ2R3bJZiNSa2KiNdeI8A+79Tc= -github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= +github.com/valyala/fasthttp v1.49.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/opafiber/go.mod b/opafiber/go.mod index f6cbfe71..0bb26c6a 100644 --- a/opafiber/go.mod +++ b/opafiber/go.mod @@ -3,7 +3,7 @@ module github.com/gofiber/contrib/opafiber/v2 go 1.19 require ( - github.com/gofiber/fiber/v2 v2.49.0 + github.com/gofiber/fiber/v2 v2.49.1 github.com/open-policy-agent/opa v0.56.0 github.com/stretchr/testify v1.8.4 ) @@ -33,11 +33,11 @@ require ( github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.10.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/tchap/go-patricia/v2 v2.3.1 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.48.0 // indirect + github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect @@ -46,7 +46,7 @@ require ( go.opentelemetry.io/otel/metric v1.16.0 // indirect go.opentelemetry.io/otel/sdk v1.16.0 // indirect go.opentelemetry.io/otel/trace v1.16.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/opafiber/go.sum b/opafiber/go.sum index 4f4a5d93..597970d9 100644 --- a/opafiber/go.sum +++ b/opafiber/go.sum @@ -33,8 +33,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= -github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= +github.com/gofiber/fiber/v2 v2.49.1 h1:0W2DRWevSirc8pJl4o8r8QejDR8TV6ZUCawHxwbIdOk= +github.com/gofiber/fiber/v2 v2.49.1/go.mod h1:nPUeEBUeeYGgwbDm59Gp7vS8MDyScL6ezr/Np9A13WU= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -81,8 +81,9 @@ github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+Pymzi github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -94,8 +95,8 @@ github.com/tchap/go-patricia/v2 v2.3.1 h1:6rQp39lgIYZ+MHmdEq4xzuk1t7OdC35z/xm0BG github.com/tchap/go-patricia/v2 v2.3.1/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.48.0 h1:oJWvHb9BIZToTQS3MuQ2R3bJZiNSa2KiNdeI8A+79Tc= -github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= +github.com/valyala/fasthttp v1.49.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= @@ -123,8 +124,8 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 h1:9NWlQfY2ePejTmfwUH1OWwmznFa+0kKcHGPDvcPza9M= diff --git a/otelfiber/example/go.mod b/otelfiber/example/go.mod index 2dfab1b7..586899dd 100644 --- a/otelfiber/example/go.mod +++ b/otelfiber/example/go.mod @@ -6,7 +6,7 @@ replace github.com/gofiber/contrib/otelfiber => ../ require ( github.com/gofiber/contrib/otelfiber v1.0.9 - github.com/gofiber/fiber/v2 v2.49.0 + github.com/gofiber/fiber/v2 v2.49.1 go.opentelemetry.io/otel v1.17.0 go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.17.0 go.opentelemetry.io/otel/sdk v1.17.0 @@ -25,9 +25,9 @@ require ( github.com/mattn/go-runewidth v0.0.15 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.48.0 // indirect + github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - go.opentelemetry.io/contrib v1.17.0 // indirect + go.opentelemetry.io/contrib v1.18.0 // indirect go.opentelemetry.io/otel/metric v1.17.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect ) diff --git a/otelfiber/example/go.sum b/otelfiber/example/go.sum index 962fb758..a77943bc 100644 --- a/otelfiber/example/go.sum +++ b/otelfiber/example/go.sum @@ -6,8 +6,8 @@ github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= -github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= +github.com/gofiber/fiber/v2 v2.49.1 h1:0W2DRWevSirc8pJl4o8r8QejDR8TV6ZUCawHxwbIdOk= +github.com/gofiber/fiber/v2 v2.49.1/go.mod h1:nPUeEBUeeYGgwbDm59Gp7vS8MDyScL6ezr/Np9A13WU= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -27,12 +27,12 @@ github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUc github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.48.0 h1:oJWvHb9BIZToTQS3MuQ2R3bJZiNSa2KiNdeI8A+79Tc= -github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= +github.com/valyala/fasthttp v1.49.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= -go.opentelemetry.io/contrib v1.17.0 h1:lJJdtuNsP++XHD7tXDYEFSpsqIc7DzShuXMR5PwkmzA= -go.opentelemetry.io/contrib v1.17.0/go.mod h1:gIzjwWFoGazJmtCaDgViqOSJPde2mCWzv60o0bWPcZs= +go.opentelemetry.io/contrib v1.18.0 h1:9e8CcxCt/aA8XEUvCTCaHBfV2Xx/Ul07Mwi/XW3dfAs= +go.opentelemetry.io/contrib v1.18.0/go.mod h1:gIzjwWFoGazJmtCaDgViqOSJPde2mCWzv60o0bWPcZs= go.opentelemetry.io/otel v1.17.0 h1:MW+phZ6WZ5/uk2nd93ANk/6yJ+dVrvNWUjGhnnFU5jM= go.opentelemetry.io/otel v1.17.0/go.mod h1:I2vmBGtFaODIVMBSTPVDlJSzBDNf93k60E6Ft0nyjo0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.17.0 h1:Ut6hgtYcASHwCzRHkXEtSsM251cXJPW+Z9DyLwEn6iI= @@ -45,6 +45,6 @@ go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYO go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/otelfiber/go.mod b/otelfiber/go.mod index 6ee1bdcf..add90c0c 100644 --- a/otelfiber/go.mod +++ b/otelfiber/go.mod @@ -3,7 +3,7 @@ module github.com/gofiber/contrib/otelfiber/v2 go 1.19 require ( - github.com/gofiber/fiber/v2 v2.49.0 + github.com/gofiber/fiber/v2 v2.49.1 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/contrib v1.18.0 go.opentelemetry.io/contrib/propagators/b3 v1.18.0 @@ -25,10 +25,10 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.48.0 // indirect + github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/otelfiber/go.sum b/otelfiber/go.sum index d4effb14..023d41bc 100644 --- a/otelfiber/go.sum +++ b/otelfiber/go.sum @@ -7,8 +7,8 @@ github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= -github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= +github.com/gofiber/fiber/v2 v2.49.1 h1:0W2DRWevSirc8pJl4o8r8QejDR8TV6ZUCawHxwbIdOk= +github.com/gofiber/fiber/v2 v2.49.1/go.mod h1:nPUeEBUeeYGgwbDm59Gp7vS8MDyScL6ezr/Np9A13WU= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -23,14 +23,15 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.48.0 h1:oJWvHb9BIZToTQS3MuQ2R3bJZiNSa2KiNdeI8A+79Tc= -github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= +github.com/valyala/fasthttp v1.49.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= go.opentelemetry.io/contrib v1.18.0 h1:9e8CcxCt/aA8XEUvCTCaHBfV2Xx/Ul07Mwi/XW3dfAs= @@ -49,8 +50,8 @@ go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYO go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/paseto/go.mod b/paseto/go.mod index aafd8597..043a7fd4 100644 --- a/paseto/go.mod +++ b/paseto/go.mod @@ -3,7 +3,7 @@ module github.com/gofiber/contrib/paseto go 1.18 require ( - github.com/gofiber/fiber/v2 v2.49.0 + github.com/gofiber/fiber/v2 v2.49.1 github.com/google/uuid v1.3.1 github.com/o1egl/paseto v1.0.0 golang.org/x/crypto v0.12.0 @@ -21,7 +21,7 @@ require ( github.com/pkg/errors v0.8.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.48.0 // indirect + github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect golang.org/x/sys v0.11.0 // indirect ) diff --git a/paseto/go.sum b/paseto/go.sum index 16022498..c14e93a2 100644 --- a/paseto/go.sum +++ b/paseto/go.sum @@ -8,8 +8,8 @@ github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/ github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= -github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= +github.com/gofiber/fiber/v2 v2.49.1 h1:0W2DRWevSirc8pJl4o8r8QejDR8TV6ZUCawHxwbIdOk= +github.com/gofiber/fiber/v2 v2.49.1/go.mod h1:nPUeEBUeeYGgwbDm59Gp7vS8MDyScL6ezr/Np9A13WU= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= @@ -33,8 +33,8 @@ github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.48.0 h1:oJWvHb9BIZToTQS3MuQ2R3bJZiNSa2KiNdeI8A+79Tc= -github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= +github.com/valyala/fasthttp v1.49.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= diff --git a/swagger/go.mod b/swagger/go.mod index 906d149c..e6608205 100644 --- a/swagger/go.mod +++ b/swagger/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/go-openapi/loads v0.21.2 github.com/go-openapi/runtime v0.26.0 - github.com/gofiber/fiber/v2 v2.49.0 + github.com/gofiber/fiber/v2 v2.49.1 github.com/gorilla/handlers v1.5.1 github.com/stretchr/testify v1.8.4 github.com/valyala/fasthttp v1.49.0 @@ -34,10 +34,10 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.mongodb.org/mongo-driver v1.11.3 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/swagger/go.sum b/swagger/go.sum index dbc45e2b..8ddc1ca4 100644 --- a/swagger/go.sum +++ b/swagger/go.sum @@ -72,8 +72,8 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= -github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= +github.com/gofiber/fiber/v2 v2.49.1 h1:0W2DRWevSirc8pJl4o8r8QejDR8TV6ZUCawHxwbIdOk= +github.com/gofiber/fiber/v2 v2.49.1/go.mod h1:nPUeEBUeeYGgwbDm59Gp7vS8MDyScL6ezr/Np9A13WU= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -127,8 +127,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -194,8 +195,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= diff --git a/websocket/go.mod b/websocket/go.mod index d32e4155..0e3d7f03 100644 --- a/websocket/go.mod +++ b/websocket/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/fasthttp/websocket v1.5.4 - github.com/gofiber/fiber/v2 v2.49.0 + github.com/gofiber/fiber/v2 v2.49.1 github.com/stretchr/testify v1.8.4 github.com/valyala/fasthttp v1.49.0 ) @@ -18,10 +18,10 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/websocket/go.sum b/websocket/go.sum index f391515e..4b52d4f2 100644 --- a/websocket/go.sum +++ b/websocket/go.sum @@ -4,8 +4,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fasthttp/websocket v1.5.4 h1:Bq8HIcoiffh3pmwSKB8FqaNooluStLQQxnzQspMatgI= github.com/fasthttp/websocket v1.5.4/go.mod h1:R2VXd4A6KBspb5mTrsWnZwn6ULkX56/Ktk8/0UNSJao= -github.com/gofiber/fiber/v2 v2.49.0 h1:xBVG2c66GDcWfww56xHvMn52Q0XX7UrSvjj6MD8/5EE= -github.com/gofiber/fiber/v2 v2.49.0/go.mod h1:oxpt7wQaEYgdDmq7nMxCGhilYicBLFnZ+jQSJcQDlSE= +github.com/gofiber/fiber/v2 v2.49.1 h1:0W2DRWevSirc8pJl4o8r8QejDR8TV6ZUCawHxwbIdOk= +github.com/gofiber/fiber/v2 v2.49.1/go.mod h1:nPUeEBUeeYGgwbDm59Gp7vS8MDyScL6ezr/Np9A13WU= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= @@ -19,8 +19,9 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee h1:8Iv5m6xEo1NR1AvpV+7XmhI4r39LGNzwUL4YpMuL5vk= github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee/go.mod h1:qwtSXrKuJh/zsFQ12yEE89xfCrGKK63Rr7ctU/uCo4g= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= @@ -33,8 +34,8 @@ github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVS github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From cd6abf06d982aa957829366be7b1c9e6e939892c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Werner?= Date: Mon, 4 Sep 2023 08:53:51 +0200 Subject: [PATCH 06/16] revert not i18n related changes --- fiberzerolog/go.mod | 4 ++-- fiberzerolog/go.sum | 7 +++---- jwt/go.mod | 4 ++-- jwt/go.sum | 7 +++---- opafiber/go.mod | 4 ++-- opafiber/go.sum | 7 +++---- otelfiber/example/go.mod | 2 +- otelfiber/example/go.sum | 4 ++-- otelfiber/go.mod | 4 ++-- otelfiber/go.sum | 7 +++---- swagger/go.mod | 4 ++-- swagger/go.sum | 7 +++---- websocket/go.mod | 4 ++-- websocket/go.sum | 7 +++---- 14 files changed, 33 insertions(+), 39 deletions(-) diff --git a/fiberzerolog/go.mod b/fiberzerolog/go.mod index 5a74411b..cf8d5728 100644 --- a/fiberzerolog/go.mod +++ b/fiberzerolog/go.mod @@ -14,9 +14,9 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect ) diff --git a/fiberzerolog/go.sum b/fiberzerolog/go.sum index 4e16f79c..31dbb6e9 100644 --- a/fiberzerolog/go.sum +++ b/fiberzerolog/go.sum @@ -18,9 +18,8 @@ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c= github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= @@ -34,5 +33,5 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/jwt/go.mod b/jwt/go.mod index 1b8bcdfc..9b9b623e 100644 --- a/jwt/go.mod +++ b/jwt/go.mod @@ -15,9 +15,9 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect ) diff --git a/jwt/go.sum b/jwt/go.sum index 92f0a52c..eb4f0b92 100644 --- a/jwt/go.sum +++ b/jwt/go.sum @@ -17,9 +17,8 @@ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APP github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= @@ -28,5 +27,5 @@ github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVS github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/opafiber/go.mod b/opafiber/go.mod index 0bb26c6a..4e62276f 100644 --- a/opafiber/go.mod +++ b/opafiber/go.mod @@ -33,7 +33,7 @@ require ( github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.10.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/tchap/go-patricia/v2 v2.3.1 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect @@ -46,7 +46,7 @@ require ( go.opentelemetry.io/otel/metric v1.16.0 // indirect go.opentelemetry.io/otel/sdk v1.16.0 // indirect go.opentelemetry.io/otel/trace v1.16.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/opafiber/go.sum b/opafiber/go.sum index 597970d9..b5e7f009 100644 --- a/opafiber/go.sum +++ b/opafiber/go.sum @@ -81,9 +81,8 @@ github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+Pymzi github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -124,8 +123,8 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 h1:9NWlQfY2ePejTmfwUH1OWwmznFa+0kKcHGPDvcPza9M= diff --git a/otelfiber/example/go.mod b/otelfiber/example/go.mod index 586899dd..6a64c30d 100644 --- a/otelfiber/example/go.mod +++ b/otelfiber/example/go.mod @@ -29,5 +29,5 @@ require ( github.com/valyala/tcplisten v1.0.0 // indirect go.opentelemetry.io/contrib v1.18.0 // indirect go.opentelemetry.io/otel/metric v1.17.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect ) diff --git a/otelfiber/example/go.sum b/otelfiber/example/go.sum index a77943bc..3b86605d 100644 --- a/otelfiber/example/go.sum +++ b/otelfiber/example/go.sum @@ -45,6 +45,6 @@ go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYO go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/otelfiber/go.mod b/otelfiber/go.mod index add90c0c..827df3eb 100644 --- a/otelfiber/go.mod +++ b/otelfiber/go.mod @@ -25,10 +25,10 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/otelfiber/go.sum b/otelfiber/go.sum index 023d41bc..74ce84a6 100644 --- a/otelfiber/go.sum +++ b/otelfiber/go.sum @@ -23,9 +23,8 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= @@ -50,8 +49,8 @@ go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYO go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/swagger/go.mod b/swagger/go.mod index e6608205..d4fe4caa 100644 --- a/swagger/go.mod +++ b/swagger/go.mod @@ -34,10 +34,10 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.mongodb.org/mongo-driver v1.11.3 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/swagger/go.sum b/swagger/go.sum index 8ddc1ca4..3d1d4807 100644 --- a/swagger/go.sum +++ b/swagger/go.sum @@ -127,9 +127,8 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -195,8 +194,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= diff --git a/websocket/go.mod b/websocket/go.mod index 0e3d7f03..59509361 100644 --- a/websocket/go.mod +++ b/websocket/go.mod @@ -18,10 +18,10 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/websocket/go.sum b/websocket/go.sum index 4b52d4f2..7897305e 100644 --- a/websocket/go.sum +++ b/websocket/go.sum @@ -19,9 +19,8 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee h1:8Iv5m6xEo1NR1AvpV+7XmhI4r39LGNzwUL4YpMuL5vk= github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee/go.mod h1:qwtSXrKuJh/zsFQ12yEE89xfCrGKK63Rr7ctU/uCo4g= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= @@ -34,8 +33,8 @@ github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVS github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From b80b25c29f95e99741e621418bc04181397520db Mon Sep 17 00:00:00 2001 From: Skyenought <1808644906@qq.com> Date: Mon, 28 Aug 2023 18:50:50 +0800 Subject: [PATCH 07/16] =?UTF-8?q?=F0=9F=A9=B9=20(fiberi18n):=20Fix=20reque?= =?UTF-8?q?st=20concurrency=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fiberi18n/README.md | 36 ++++++++++++++++++++---------------- fiberi18n/config.go | 5 ++++- fiberi18n/embed_test.go | 5 +++-- fiberi18n/example/main.go | 4 ++-- fiberi18n/i18n.go | 34 ++++++++++++++++++---------------- fiberi18n/i18n_test.go | 5 +++-- 6 files changed, 50 insertions(+), 39 deletions(-) diff --git a/fiberi18n/README.md b/fiberi18n/README.md index f5418428..3ae53268 100644 --- a/fiberi18n/README.md +++ b/fiberi18n/README.md @@ -25,22 +25,24 @@ go get -u github.com/gofiber/contrib/fiberi18n ## Signature -``` -fiberi18n.New(config ...*fiberi18n.Config) fiber.Handler -``` +| Name | Signature | Description | +|--------------|--------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------| +| New | `New(config ...*fiberi18n.Config) fiber.Handler` | Create a new fiberi18n middleware handler | +| Localize | `Localize(ctx *fiber.Ctx, params interface{}) (string, error)` | Localize returns a localized message. param is one of these type: messageID, *i18n.LocalizeConfig | +| MustLocalize | `MustLocalize(ctx *fiber.Ctx, params interface{}) (string, error)` | MustLocalize is similar to Localize, except it panics if an error happens. param is one of these type: messageID, *i18n.LocalizeConfig | ## Config -| Property | Type | Description | Default | -| ---------------- | ------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| Next | `func(c *fiber.Ctx) bool` | A function to skip this middleware when returned `true`. | `nil` | -| RootPath | `string` | The i18n template folder path. | `"./example/localize"` | -| AcceptLanguages | `[]language.Tag` | A collection of languages that can be processed. | `[]language.Tag{language.Chinese, language.English}` | -| FormatBundleFile | `string` | The type of the template file. | `"yaml"` | -| DefaultLanguage | `language.Tag` | The default returned language type. | `language.English` | -| Loader | `Loader` | The implementation of the Loader interface, which defines how to read the file. We provide both os.ReadFile and embed.FS.ReadFile. | `LoaderFunc(os.ReadFile)` | -| UnmarshalFunc | `i18n.UnmarshalFunc` | The function used for decoding template files. | `yaml.Unmarshal` | -| LangHandler | `func(ctx *fiber.Ctx, defaultLang string) string` | Used to get the kind of language handled by *fiber.Ctx and defaultLang. | Retrieved from the request header `Accept-Language` or query parameter `lang`. | +| Property | Type | Description | Default | +|------------------|---------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------| +| Next | `func(c *fiber.Ctx) bool` | A function to skip this middleware when returned `true`. | `nil` | +| RootPath | `string` | The i18n template folder path. | `"./example/localize"` | +| AcceptLanguages | `[]language.Tag` | A collection of languages that can be processed. | `[]language.Tag{language.Chinese, language.English}` | +| FormatBundleFile | `string` | The type of the template file. | `"yaml"` | +| DefaultLanguage | `language.Tag` | The default returned language type. | `language.English` | +| Loader | `Loader` | The implementation of the Loader interface, which defines how to read the file. We provide both os.ReadFile and embed.FS.ReadFile. | `LoaderFunc(os.ReadFile)` | +| UnmarshalFunc | `i18n.UnmarshalFunc` | The function used for decoding template files. | `yaml.Unmarshal` | +| LangHandler | `func(ctx *fiber.Ctx, defaultLang string) string` | Used to get the kind of language handled by *fiber.Ctx and defaultLang. | Retrieved from the request header `Accept-Language` or query parameter `lang`. | ## Example @@ -48,6 +50,8 @@ fiberi18n.New(config ...*fiberi18n.Config) fiber.Handler package main import ( + "log" + "github.com/gofiber/contrib/fiberi18n" "github.com/gofiber/fiber/v2" "github.com/nicksnyder/go-i18n/v2/i18n" @@ -64,17 +68,17 @@ func main() { }), ) app.Get("/", func(c *fiber.Ctx) error { - return c.SendString(fiberi18n.MustGetMessage("welcome")) + return c.SendString(fiberi18n.MustLocalize(c, "welcome")) }) app.Get("/:name", func(ctx *fiber.Ctx) error { - return ctx.SendString(fiberi18n.MustGetMessage(&i18n.LocalizeConfig{ + return ctx.SendString(fiberi18n.MustLocalize(ctx, &i18n.LocalizeConfig{ MessageID: "welcomeWithName", TemplateData: map[string]string{ "name": ctx.Params("name"), }, })) }) - app.Listen("127.0.0.1:3000") + log.Fatal(app.Listen(":3000")) } ``` diff --git a/fiberi18n/config.go b/fiberi18n/config.go index 247270c7..d1afad6c 100644 --- a/fiberi18n/config.go +++ b/fiberi18n/config.go @@ -52,7 +52,6 @@ type Config struct { // Optional. Default: The language type is retrieved from the request header: `Accept-Language` or query param : `lang` LangHandler func(ctx *fiber.Ctx, defaultLang string) string - ctx *fiber.Ctx bundle *i18n.Bundle localizerMap *sync.Map } @@ -68,6 +67,7 @@ func (f LoaderFunc) LoadMessage(path string) ([]byte, error) { } var ConfigDefault = &Config{ + Next: nil, RootPath: "./example/localize", DefaultLanguage: language.English, AcceptLanguages: []language.Tag{language.Chinese, language.English}, @@ -78,6 +78,9 @@ var ConfigDefault = &Config{ } func defaultLangHandler(c *fiber.Ctx, defaultLang string) string { + if c == nil || c.Request() == nil { + return defaultLang + } var lang string lang = utils.CopyString(c.Query("lang")) if lang != "" { diff --git a/fiberi18n/embed_test.go b/fiberi18n/embed_test.go index 7e8bec4c..384cb12f 100644 --- a/fiberi18n/embed_test.go +++ b/fiberi18n/embed_test.go @@ -26,10 +26,10 @@ func newEmbedServer() *fiber.App { FormatBundleFile: "json", })) app.Get("/", func(ctx *fiber.Ctx) error { - return ctx.SendString(MustGetMessage("welcome")) + return ctx.SendString(MustLocalize(ctx, "welcome")) }) app.Get("/:name", func(ctx *fiber.Ctx) error { - return ctx.SendString(MustGetMessage(&i18n.LocalizeConfig{ + return ctx.SendString(MustLocalize(ctx, &i18n.LocalizeConfig{ MessageID: "welcomeWithName", TemplateData: map[string]string{ "name": ctx.Params("name"), @@ -52,6 +52,7 @@ func request(lang language.Tag, name string) (*http.Response, error) { } func TestEmbedLoader_LoadMessage(t *testing.T) { + t.Parallel() type args struct { lang language.Tag name string diff --git a/fiberi18n/example/main.go b/fiberi18n/example/main.go index 576d3312..750d2590 100644 --- a/fiberi18n/example/main.go +++ b/fiberi18n/example/main.go @@ -19,10 +19,10 @@ func main() { }), ) app.Get("/", func(c *fiber.Ctx) error { - return c.SendString(fiberi18n.MustGetMessage("welcome")) + return c.SendString(fiberi18n.MustLocalize(c, "welcome")) }) app.Get("/:name", func(ctx *fiber.Ctx) error { - return ctx.SendString(fiberi18n.MustGetMessage(&i18n.LocalizeConfig{ + return ctx.SendString(fiberi18n.MustLocalize(ctx, &i18n.LocalizeConfig{ MessageID: "welcomeWithName", TemplateData: map[string]string{ "name": ctx.Params("name"), diff --git a/fiberi18n/i18n.go b/fiberi18n/i18n.go index 9be5d530..a88e0572 100644 --- a/fiberi18n/i18n.go +++ b/fiberi18n/i18n.go @@ -2,6 +2,7 @@ package fiberi18n import ( "fmt" + "github.com/gofiber/fiber/v2/log" "path" "sync" @@ -9,11 +10,9 @@ import ( "github.com/nicksnyder/go-i18n/v2/i18n" ) -var appCfg *Config - // New creates a new middleware handler func New(config ...*Config) fiber.Handler { - appCfg = configDefault(config...) + appCfg := configDefault(config...) // init bundle bundle := i18n.NewBundle(appCfg.DefaultLanguage) bundle.RegisterUnmarshalFunc(appCfg.FormatBundleFile, appCfg.UnmarshalFunc) @@ -25,9 +24,7 @@ func New(config ...*Config) fiber.Handler { if appCfg.Next != nil && appCfg.Next(c) { return c.Next() } - - appCfg.ctx = c - + c.Locals("fiberi18n", appCfg) return c.Next() } } @@ -67,38 +64,42 @@ func (c *Config) initLocalizerMap() { } /* -MustGetMessage get the i18n message without error handling +MustLocalize get the i18n message without error handling param is one of these type: messageID, *i18n.LocalizeConfig Example: - MustGetMessage("hello") // messageID is hello - MustGetMessage(&i18n.LocalizeConfig{ + MustLocalize(ctx, "hello") // messageID is hello + MustLocalize(ctx, &i18n.LocalizeConfig{ MessageID: "welcomeWithName", TemplateData: map[string]string{ "name": context.Param("name"), }, }) */ -func MustGetMessage(params interface{}) string { - message, _ := GetMessage(params) +func MustLocalize(ctx *fiber.Ctx, params interface{}) string { + message, err := Localize(ctx, params) + if err != nil { + panic(err) + } return message } /* -GetMessage get the i18n message +Localize get the i18n message param is one of these type: messageID, *i18n.LocalizeConfig Example: - GetMessage("hello") // messageID is hello - GetMessage(&i18n.LocalizeConfig{ + Localize(ctx, "hello") // messageID is hello + Localize(ctx, &i18n.LocalizeConfig{ MessageID: "welcomeWithName", TemplateData: map[string]string{ "name": context.Param("name"), }, }) */ -func GetMessage(params interface{}) (string, error) { - lang := appCfg.LangHandler(appCfg.ctx, appCfg.DefaultLanguage.String()) +func Localize(ctx *fiber.Ctx, params interface{}) (string, error) { + appCfg := ctx.Locals("fiberi18n").(*Config) + lang := appCfg.LangHandler(ctx, appCfg.DefaultLanguage.String()) localizer, _ := appCfg.localizerMap.Load(lang) if localizer == nil { @@ -116,6 +117,7 @@ func GetMessage(params interface{}) (string, error) { message, err := localizer.(*i18n.Localizer).Localize(localizeConfig) if err != nil { + log.Errorf("i18n.Localize error: %v", err) return "", fmt.Errorf("i18n.Localize error: %v", err) } return message, nil diff --git a/fiberi18n/i18n_test.go b/fiberi18n/i18n_test.go index ca442bdf..ab12b393 100644 --- a/fiberi18n/i18n_test.go +++ b/fiberi18n/i18n_test.go @@ -16,10 +16,10 @@ func newServer() *fiber.App { app := fiber.New() app.Use(New()) app.Get("/", func(ctx *fiber.Ctx) error { - return ctx.SendString(MustGetMessage("welcome")) + return ctx.SendString(MustLocalize(ctx, "welcome")) }) app.Get("/:name", func(ctx *fiber.Ctx) error { - return ctx.SendString(MustGetMessage(&i18n.LocalizeConfig{ + return ctx.SendString(MustLocalize(ctx, &i18n.LocalizeConfig{ MessageID: "welcomeWithName", TemplateData: map[string]string{ "name": ctx.Params("name"), @@ -42,6 +42,7 @@ func makeRequest(lang language.Tag, name string) (*http.Response, error) { } func TestI18nEN(t *testing.T) { + t.Parallel() type args struct { lang language.Tag name string From 6cd5944d22d814e7637a254ff3fa7f2e65aff1a3 Mon Sep 17 00:00:00 2001 From: Skyenought Date: Tue, 29 Aug 2023 15:53:33 +0800 Subject: [PATCH 08/16] update to v2 --- .github/workflows/test-fiberi18n.yml | 1 - fiberi18n/README.md | 10 ++- fiberi18n/example/main.go | 8 ++- fiberi18n/go.mod | 4 +- fiberi18n/i18n_test.go | 97 ++++++++++++++++++++++++++-- 5 files changed, 106 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-fiberi18n.yml b/.github/workflows/test-fiberi18n.yml index f9933673..3d4a77cb 100644 --- a/.github/workflows/test-fiberi18n.yml +++ b/.github/workflows/test-fiberi18n.yml @@ -17,7 +17,6 @@ jobs: strategy: matrix: go-version: - - 1.18.x - 1.19.x - 1.20.x - 1.21.x diff --git a/fiberi18n/README.md b/fiberi18n/README.md index 3ae53268..da4404f8 100644 --- a/fiberi18n/README.md +++ b/fiberi18n/README.md @@ -20,7 +20,7 @@ This middleware supports Fiber v2. ``` go get -u github.com/gofiber/fiber/v2 -go get -u github.com/gofiber/contrib/fiberi18n +go get -u github.com/gofiber/contrib/fiberi18n/v2 ``` ## Signature @@ -52,7 +52,7 @@ package main import ( "log" - "github.com/gofiber/contrib/fiberi18n" + "github.com/gofiber/contrib/fiberi18n/v2" "github.com/gofiber/fiber/v2" "github.com/nicksnyder/go-i18n/v2/i18n" "golang.org/x/text/language" @@ -68,7 +68,11 @@ func main() { }), ) app.Get("/", func(c *fiber.Ctx) error { - return c.SendString(fiberi18n.MustLocalize(c, "welcome")) + localize, err := fiberi18n.Localize(c, "welcome") + if err != nil { + return c.Status(fiber.StatusInternalServerError).SendString(err.Error()) + } + return c.SendString(localize) }) app.Get("/:name", func(ctx *fiber.Ctx) error { return ctx.SendString(fiberi18n.MustLocalize(ctx, &i18n.LocalizeConfig{ diff --git a/fiberi18n/example/main.go b/fiberi18n/example/main.go index 750d2590..5f07e7ef 100644 --- a/fiberi18n/example/main.go +++ b/fiberi18n/example/main.go @@ -3,7 +3,7 @@ package main import ( "log" - "github.com/gofiber/contrib/fiberi18n" + "github.com/gofiber/contrib/fiberi18n/v2" "github.com/gofiber/fiber/v2" "github.com/nicksnyder/go-i18n/v2/i18n" "golang.org/x/text/language" @@ -19,7 +19,11 @@ func main() { }), ) app.Get("/", func(c *fiber.Ctx) error { - return c.SendString(fiberi18n.MustLocalize(c, "welcome")) + localize, err := fiberi18n.Localize(c, "welcome") + if err != nil { + return c.Status(fiber.StatusInternalServerError).SendString(err.Error()) + } + return c.SendString(localize) }) app.Get("/:name", func(ctx *fiber.Ctx) error { return ctx.SendString(fiberi18n.MustLocalize(ctx, &i18n.LocalizeConfig{ diff --git a/fiberi18n/go.mod b/fiberi18n/go.mod index a0cbfaaa..6952e94f 100644 --- a/fiberi18n/go.mod +++ b/fiberi18n/go.mod @@ -1,6 +1,6 @@ -module github.com/gofiber/contrib/fiberi18n +module github.com/gofiber/contrib/fiberi18n/v2 -go 1.18 +go 1.19 require ( github.com/gofiber/fiber/v2 v2.49.1 diff --git a/fiberi18n/i18n_test.go b/fiberi18n/i18n_test.go index ab12b393..098297ac 100644 --- a/fiberi18n/i18n_test.go +++ b/fiberi18n/i18n_test.go @@ -4,6 +4,7 @@ import ( "context" "io" "net/http" + "sync" "testing" "github.com/gofiber/fiber/v2" @@ -31,13 +32,15 @@ func newServer() *fiber.App { var i18nApp = newServer() -func makeRequest(lang language.Tag, name string) (*http.Response, error) { +func makeRequest(lang language.Tag, name string, app *fiber.App) (*http.Response, error) { path := "/" + name req, _ := http.NewRequestWithContext(context.Background(), "GET", path, nil) - req.Header.Add("Accept-Language", lang.String()) + if lang != language.Und { + req.Header.Add("Accept-Language", lang.String()) + } req.Method = "GET" req.RequestURI = path - resp, err := i18nApp.Test(req) + resp, err := app.Test(req) return resp, err } @@ -71,7 +74,7 @@ func TestI18nEN(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := makeRequest(tt.args.lang, tt.args.name) + got, err := makeRequest(tt.args.lang, tt.args.name, i18nApp) utils.AssertEqual(t, err, nil) body, err := io.ReadAll(got.Body) utils.AssertEqual(t, err, nil) @@ -109,7 +112,7 @@ func TestI18nZH(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := makeRequest(tt.args.lang, tt.args.name) + got, err := makeRequest(tt.args.lang, tt.args.name, i18nApp) utils.AssertEqual(t, err, nil) body, err := io.ReadAll(got.Body) utils.AssertEqual(t, err, nil) @@ -156,7 +159,7 @@ func TestParallelI18n(t *testing.T) { t.Parallel() for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := makeRequest(tt.args.lang, tt.args.name) + got, err := makeRequest(tt.args.lang, tt.args.name, i18nApp) utils.AssertEqual(t, err, nil) body, err := io.ReadAll(got.Body) utils.AssertEqual(t, err, nil) @@ -164,3 +167,85 @@ func TestParallelI18n(t *testing.T) { }) } } + +func TestLocalize(t *testing.T) { + t.Parallel() + app := fiber.New() + app.Use(New()) + app.Get("/", func(ctx *fiber.Ctx) error { + localize, err := Localize(ctx, "welcome?") + utils.AssertEqual(t, "", localize) + return fiber.NewError(500, err.Error()) + }) + + app.Get("/:name", func(ctx *fiber.Ctx) error { + name := ctx.Params("name") + localize, err := Localize(ctx, &i18n.LocalizeConfig{ + MessageID: "welcomeWithName", + TemplateData: map[string]string{ + "name": name, + }, + }) + utils.AssertEqual(t, nil, err) + return ctx.SendString(localize) + }) + + t.Run("test localize", func(t *testing.T) { + got, err := makeRequest(language.Chinese, "", app) + utils.AssertEqual(t, 500, got.StatusCode) + utils.AssertEqual(t, nil, err) + body, _ := io.ReadAll(got.Body) + utils.AssertEqual(t, `i18n.Localize error: message "welcome?" not found in language "zh"`, string(body)) + + got, err = makeRequest(language.English, "name", app) + utils.AssertEqual(t, 200, got.StatusCode) + utils.AssertEqual(t, nil, err) + body, _ = io.ReadAll(got.Body) + utils.AssertEqual(t, "hello name", string(body)) + }) +} + +func Test_defaultLangHandler(t *testing.T) { + t.Parallel() + app := fiber.New() + app.Use(New()) + app.Get("/", func(c *fiber.Ctx) error { + return c.SendString(defaultLangHandler(nil, language.English.String())) + }) + app.Get("/test", func(c *fiber.Ctx) error { + return c.SendString(defaultLangHandler(c, language.English.String())) + }) + + t.Run("test nil ctx", func(t *testing.T) { + var wg sync.WaitGroup + want := 100 + wg.Add(want) + for i := 0; i < want; i++ { + go func() { + defer wg.Done() + got, err := makeRequest(language.English, "", app) + utils.AssertEqual(t, nil, err) + body, _ := io.ReadAll(got.Body) + utils.AssertEqual(t, "en", string(body)) + }() + } + wg.Wait() + }) + + t.Run("test query and header", func(t *testing.T) { + got, err := makeRequest(language.Chinese, "test?lang=en", app) + utils.AssertEqual(t, nil, err) + body, _ := io.ReadAll(got.Body) + utils.AssertEqual(t, "en", string(body)) + + got, err = makeRequest(language.Chinese, "test", app) + utils.AssertEqual(t, nil, err) + body, _ = io.ReadAll(got.Body) + utils.AssertEqual(t, "zh", string(body)) + + got, err = makeRequest(language.Chinese, "test", app) + utils.AssertEqual(t, nil, err) + body, _ = io.ReadAll(got.Body) + utils.AssertEqual(t, "zh", string(body)) + }) +} From bd3aa5f81bb1d9fc75748815511214935527aab7 Mon Sep 17 00:00:00 2001 From: Skyenought Date: Wed, 30 Aug 2023 00:30:00 +0800 Subject: [PATCH 09/16] remove change for .github --- fiberi18n/config.go | 1 + fiberi18n/i18n.go | 28 ++++++++++++++++++++-------- fiberi18n/i18n_test.go | 3 +-- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/fiberi18n/config.go b/fiberi18n/config.go index d1afad6c..52030741 100644 --- a/fiberi18n/config.go +++ b/fiberi18n/config.go @@ -54,6 +54,7 @@ type Config struct { bundle *i18n.Bundle localizerMap *sync.Map + mu sync.Mutex } type Loader interface { diff --git a/fiberi18n/i18n.go b/fiberi18n/i18n.go index a88e0572..da05a435 100644 --- a/fiberi18n/i18n.go +++ b/fiberi18n/i18n.go @@ -12,19 +12,20 @@ import ( // New creates a new middleware handler func New(config ...*Config) fiber.Handler { - appCfg := configDefault(config...) + cfg := configDefault(config...) // init bundle - bundle := i18n.NewBundle(appCfg.DefaultLanguage) - bundle.RegisterUnmarshalFunc(appCfg.FormatBundleFile, appCfg.UnmarshalFunc) - appCfg.bundle = bundle + bundle := i18n.NewBundle(cfg.DefaultLanguage) + bundle.RegisterUnmarshalFunc(cfg.FormatBundleFile, cfg.UnmarshalFunc) + cfg.bundle = bundle - appCfg.loadMessages().initLocalizerMap() + cfg.loadMessages() + cfg.initLocalizerMap() return func(c *fiber.Ctx) error { - if appCfg.Next != nil && appCfg.Next(c) { + if cfg.Next != nil && cfg.Next(c) { return c.Next() } - c.Locals("fiberi18n", appCfg) + c.Locals("fiberi18n", cfg) return c.Next() } } @@ -40,6 +41,8 @@ func (c *Config) loadMessage(filepath string) { } func (c *Config) loadMessages() *Config { + c.mu.Lock() + defer c.mu.Unlock() for _, lang := range c.AcceptLanguages { bundleFilePath := fmt.Sprintf("%s.%s", lang.String(), c.FormatBundleFile) filepath := path.Join(c.RootPath, bundleFilePath) @@ -60,7 +63,16 @@ func (c *Config) initLocalizerMap() { if _, ok := localizerMap.Load(lang); !ok { localizerMap.Store(lang, i18n.NewLocalizer(c.bundle, lang)) } - c.localizerMap = localizerMap + c.mu.Lock() + + newLocalizerMap := &sync.Map{} + localizerMap.Range(func(key, value interface{}) bool { + newLocalizerMap.Store(key, value) + return true + }) + + c.localizerMap = newLocalizerMap + c.mu.Unlock() } /* diff --git a/fiberi18n/i18n_test.go b/fiberi18n/i18n_test.go index 098297ac..de79098f 100644 --- a/fiberi18n/i18n_test.go +++ b/fiberi18n/i18n_test.go @@ -206,7 +206,6 @@ func TestLocalize(t *testing.T) { } func Test_defaultLangHandler(t *testing.T) { - t.Parallel() app := fiber.New() app.Use(New()) app.Get("/", func(c *fiber.Ctx) error { @@ -215,7 +214,7 @@ func Test_defaultLangHandler(t *testing.T) { app.Get("/test", func(c *fiber.Ctx) error { return c.SendString(defaultLangHandler(c, language.English.String())) }) - + t.Parallel() t.Run("test nil ctx", func(t *testing.T) { var wg sync.WaitGroup want := 100 From 6f6ca3be9525670bd58291c7ce5828315b144468 Mon Sep 17 00:00:00 2001 From: Skyenought Date: Sun, 3 Sep 2023 10:47:04 +0800 Subject: [PATCH 10/16] upgraded github.com/gofiber/fiber/v2 --- fiberi18n/go.mod | 6 +++--- fiberi18n/go.sum | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fiberi18n/go.mod b/fiberi18n/go.mod index 6952e94f..dcfea1ac 100644 --- a/fiberi18n/go.mod +++ b/fiberi18n/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/gofiber/fiber/v2 v2.49.1 github.com/nicksnyder/go-i18n/v2 v2.2.1 - golang.org/x/text v0.12.0 + golang.org/x/text v0.13.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -16,9 +16,9 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect ) diff --git a/fiberi18n/go.sum b/fiberi18n/go.sum index f4137da2..96cb3cd3 100644 --- a/fiberi18n/go.sum +++ b/fiberi18n/go.sum @@ -17,8 +17,9 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/nicksnyder/go-i18n/v2 v2.2.1 h1:aOzRCdwsJuoExfZhoiXHy4bjruwCMdt5otbYojM/PaA= github.com/nicksnyder/go-i18n/v2 v2.2.1/go.mod h1:fF2++lPHlo+/kPaj3nB0uxtPwzlPm+BlgwGX7MkeGj0= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= @@ -41,16 +42,16 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 79036fb37c386e11e839a7add8702ca378e49767 Mon Sep 17 00:00:00 2001 From: Skyenought Date: Sun, 3 Sep 2023 11:16:12 +0800 Subject: [PATCH 11/16] upgraded github.com/gofiber/fiber/v2 --- fiberi18n/i18n.go | 3 +-- fiberzerolog/go.mod | 4 ++-- fiberzerolog/go.sum | 7 ++++--- jwt/go.mod | 4 ++-- jwt/go.sum | 7 ++++--- opafiber/go.mod | 4 ++-- opafiber/go.sum | 7 ++++--- otelfiber/example/go.mod | 2 +- otelfiber/example/go.sum | 4 ++-- otelfiber/go.mod | 4 ++-- otelfiber/go.sum | 7 ++++--- swagger/go.mod | 4 ++-- swagger/go.sum | 7 ++++--- websocket/go.mod | 4 ++-- websocket/go.sum | 7 ++++--- 15 files changed, 40 insertions(+), 35 deletions(-) diff --git a/fiberi18n/i18n.go b/fiberi18n/i18n.go index da05a435..56ee0cdd 100644 --- a/fiberi18n/i18n.go +++ b/fiberi18n/i18n.go @@ -64,7 +64,7 @@ func (c *Config) initLocalizerMap() { localizerMap.Store(lang, i18n.NewLocalizer(c.bundle, lang)) } c.mu.Lock() - + defer c.mu.Unlock() newLocalizerMap := &sync.Map{} localizerMap.Range(func(key, value interface{}) bool { newLocalizerMap.Store(key, value) @@ -72,7 +72,6 @@ func (c *Config) initLocalizerMap() { }) c.localizerMap = newLocalizerMap - c.mu.Unlock() } /* diff --git a/fiberzerolog/go.mod b/fiberzerolog/go.mod index cf8d5728..5a74411b 100644 --- a/fiberzerolog/go.mod +++ b/fiberzerolog/go.mod @@ -14,9 +14,9 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect ) diff --git a/fiberzerolog/go.sum b/fiberzerolog/go.sum index 31dbb6e9..4e16f79c 100644 --- a/fiberzerolog/go.sum +++ b/fiberzerolog/go.sum @@ -18,8 +18,9 @@ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c= github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= @@ -33,5 +34,5 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/jwt/go.mod b/jwt/go.mod index 9b9b623e..1b8bcdfc 100644 --- a/jwt/go.mod +++ b/jwt/go.mod @@ -15,9 +15,9 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect ) diff --git a/jwt/go.sum b/jwt/go.sum index eb4f0b92..92f0a52c 100644 --- a/jwt/go.sum +++ b/jwt/go.sum @@ -17,8 +17,9 @@ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APP github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= @@ -27,5 +28,5 @@ github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVS github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/opafiber/go.mod b/opafiber/go.mod index 4e62276f..0bb26c6a 100644 --- a/opafiber/go.mod +++ b/opafiber/go.mod @@ -33,7 +33,7 @@ require ( github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.10.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/tchap/go-patricia/v2 v2.3.1 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect @@ -46,7 +46,7 @@ require ( go.opentelemetry.io/otel/metric v1.16.0 // indirect go.opentelemetry.io/otel/sdk v1.16.0 // indirect go.opentelemetry.io/otel/trace v1.16.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/opafiber/go.sum b/opafiber/go.sum index b5e7f009..597970d9 100644 --- a/opafiber/go.sum +++ b/opafiber/go.sum @@ -81,8 +81,9 @@ github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+Pymzi github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -123,8 +124,8 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 h1:9NWlQfY2ePejTmfwUH1OWwmznFa+0kKcHGPDvcPza9M= diff --git a/otelfiber/example/go.mod b/otelfiber/example/go.mod index 6a64c30d..586899dd 100644 --- a/otelfiber/example/go.mod +++ b/otelfiber/example/go.mod @@ -29,5 +29,5 @@ require ( github.com/valyala/tcplisten v1.0.0 // indirect go.opentelemetry.io/contrib v1.18.0 // indirect go.opentelemetry.io/otel/metric v1.17.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect ) diff --git a/otelfiber/example/go.sum b/otelfiber/example/go.sum index 3b86605d..a77943bc 100644 --- a/otelfiber/example/go.sum +++ b/otelfiber/example/go.sum @@ -45,6 +45,6 @@ go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYO go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/otelfiber/go.mod b/otelfiber/go.mod index 827df3eb..add90c0c 100644 --- a/otelfiber/go.mod +++ b/otelfiber/go.mod @@ -25,10 +25,10 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/otelfiber/go.sum b/otelfiber/go.sum index 74ce84a6..023d41bc 100644 --- a/otelfiber/go.sum +++ b/otelfiber/go.sum @@ -23,8 +23,9 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= @@ -49,8 +50,8 @@ go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYO go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/swagger/go.mod b/swagger/go.mod index d4fe4caa..e6608205 100644 --- a/swagger/go.mod +++ b/swagger/go.mod @@ -34,10 +34,10 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.mongodb.org/mongo-driver v1.11.3 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/swagger/go.sum b/swagger/go.sum index 3d1d4807..8ddc1ca4 100644 --- a/swagger/go.sum +++ b/swagger/go.sum @@ -127,8 +127,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -194,8 +195,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= diff --git a/websocket/go.mod b/websocket/go.mod index 59509361..0e3d7f03 100644 --- a/websocket/go.mod +++ b/websocket/go.mod @@ -18,10 +18,10 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/websocket/go.sum b/websocket/go.sum index 7897305e..4b52d4f2 100644 --- a/websocket/go.sum +++ b/websocket/go.sum @@ -19,8 +19,9 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee h1:8Iv5m6xEo1NR1AvpV+7XmhI4r39LGNzwUL4YpMuL5vk= github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee/go.mod h1:qwtSXrKuJh/zsFQ12yEE89xfCrGKK63Rr7ctU/uCo4g= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= @@ -33,8 +34,8 @@ github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVS github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From fa32c39452a2f11d1e1c5993d153c57399ce27a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Werner?= Date: Mon, 4 Sep 2023 08:53:51 +0200 Subject: [PATCH 12/16] revert not i18n related changes --- fiberzerolog/go.mod | 4 ++-- fiberzerolog/go.sum | 7 +++---- jwt/go.mod | 4 ++-- jwt/go.sum | 7 +++---- opafiber/go.mod | 4 ++-- opafiber/go.sum | 7 +++---- otelfiber/example/go.mod | 2 +- otelfiber/example/go.sum | 4 ++-- otelfiber/go.mod | 4 ++-- otelfiber/go.sum | 7 +++---- swagger/go.mod | 4 ++-- swagger/go.sum | 7 +++---- websocket/go.mod | 4 ++-- websocket/go.sum | 7 +++---- 14 files changed, 33 insertions(+), 39 deletions(-) diff --git a/fiberzerolog/go.mod b/fiberzerolog/go.mod index 5a74411b..cf8d5728 100644 --- a/fiberzerolog/go.mod +++ b/fiberzerolog/go.mod @@ -14,9 +14,9 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect ) diff --git a/fiberzerolog/go.sum b/fiberzerolog/go.sum index 4e16f79c..31dbb6e9 100644 --- a/fiberzerolog/go.sum +++ b/fiberzerolog/go.sum @@ -18,9 +18,8 @@ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c= github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= @@ -34,5 +33,5 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/jwt/go.mod b/jwt/go.mod index 1b8bcdfc..9b9b623e 100644 --- a/jwt/go.mod +++ b/jwt/go.mod @@ -15,9 +15,9 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect ) diff --git a/jwt/go.sum b/jwt/go.sum index 92f0a52c..eb4f0b92 100644 --- a/jwt/go.sum +++ b/jwt/go.sum @@ -17,9 +17,8 @@ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APP github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.49.0 h1:9FdvCpmxB74LH4dPb7IJ1cOSsluR07XG3I1txXWwJpE= @@ -28,5 +27,5 @@ github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVS github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/opafiber/go.mod b/opafiber/go.mod index 0bb26c6a..4e62276f 100644 --- a/opafiber/go.mod +++ b/opafiber/go.mod @@ -33,7 +33,7 @@ require ( github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.10.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/tchap/go-patricia/v2 v2.3.1 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect @@ -46,7 +46,7 @@ require ( go.opentelemetry.io/otel/metric v1.16.0 // indirect go.opentelemetry.io/otel/sdk v1.16.0 // indirect go.opentelemetry.io/otel/trace v1.16.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/opafiber/go.sum b/opafiber/go.sum index 597970d9..b5e7f009 100644 --- a/opafiber/go.sum +++ b/opafiber/go.sum @@ -81,9 +81,8 @@ github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+Pymzi github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -124,8 +123,8 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 h1:9NWlQfY2ePejTmfwUH1OWwmznFa+0kKcHGPDvcPza9M= diff --git a/otelfiber/example/go.mod b/otelfiber/example/go.mod index 586899dd..6a64c30d 100644 --- a/otelfiber/example/go.mod +++ b/otelfiber/example/go.mod @@ -29,5 +29,5 @@ require ( github.com/valyala/tcplisten v1.0.0 // indirect go.opentelemetry.io/contrib v1.18.0 // indirect go.opentelemetry.io/otel/metric v1.17.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect ) diff --git a/otelfiber/example/go.sum b/otelfiber/example/go.sum index a77943bc..3b86605d 100644 --- a/otelfiber/example/go.sum +++ b/otelfiber/example/go.sum @@ -45,6 +45,6 @@ go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYO go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/otelfiber/go.mod b/otelfiber/go.mod index add90c0c..827df3eb 100644 --- a/otelfiber/go.mod +++ b/otelfiber/go.mod @@ -25,10 +25,10 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.49.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/otelfiber/go.sum b/otelfiber/go.sum index 023d41bc..74ce84a6 100644 --- a/otelfiber/go.sum +++ b/otelfiber/go.sum @@ -23,9 +23,8 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= @@ -50,8 +49,8 @@ go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYO go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/swagger/go.mod b/swagger/go.mod index e6608205..d4fe4caa 100644 --- a/swagger/go.mod +++ b/swagger/go.mod @@ -34,10 +34,10 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.mongodb.org/mongo-driver v1.11.3 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/swagger/go.sum b/swagger/go.sum index 8ddc1ca4..3d1d4807 100644 --- a/swagger/go.sum +++ b/swagger/go.sum @@ -127,9 +127,8 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -195,8 +194,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= diff --git a/websocket/go.mod b/websocket/go.mod index 0e3d7f03..59509361 100644 --- a/websocket/go.mod +++ b/websocket/go.mod @@ -18,10 +18,10 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.4.4 // indirect + github.com/rivo/uniseg v0.2.0 // indirect github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/sys v0.11.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/websocket/go.sum b/websocket/go.sum index 4b52d4f2..7897305e 100644 --- a/websocket/go.sum +++ b/websocket/go.sum @@ -19,9 +19,8 @@ github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee h1:8Iv5m6xEo1NR1AvpV+7XmhI4r39LGNzwUL4YpMuL5vk= github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee/go.mod h1:qwtSXrKuJh/zsFQ12yEE89xfCrGKK63Rr7ctU/uCo4g= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= @@ -34,8 +33,8 @@ github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVS github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From 64a72e7026f4d92b2ca783409761977e2ac1dbc7 Mon Sep 17 00:00:00 2001 From: Skyenought Date: Mon, 4 Sep 2023 15:53:36 +0800 Subject: [PATCH 13/16] remove useless code --- fiberi18n/i18n.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/fiberi18n/i18n.go b/fiberi18n/i18n.go index 56ee0cdd..3f9a22c1 100644 --- a/fiberi18n/i18n.go +++ b/fiberi18n/i18n.go @@ -64,14 +64,9 @@ func (c *Config) initLocalizerMap() { localizerMap.Store(lang, i18n.NewLocalizer(c.bundle, lang)) } c.mu.Lock() - defer c.mu.Unlock() - newLocalizerMap := &sync.Map{} - localizerMap.Range(func(key, value interface{}) bool { - newLocalizerMap.Store(key, value) - return true - }) + c.localizerMap = localizerMap + c.mu.Unlock() - c.localizerMap = newLocalizerMap } /* From cccecfcb3f4119ca0e31ce0e336a23c807fcc920 Mon Sep 17 00:00:00 2001 From: Skyenought Date: Mon, 4 Sep 2023 20:19:44 +0800 Subject: [PATCH 14/16] remove useless code --- fiberi18n/i18n.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/fiberi18n/i18n.go b/fiberi18n/i18n.go index 3f9a22c1..122b400c 100644 --- a/fiberi18n/i18n.go +++ b/fiberi18n/i18n.go @@ -41,8 +41,6 @@ func (c *Config) loadMessage(filepath string) { } func (c *Config) loadMessages() *Config { - c.mu.Lock() - defer c.mu.Unlock() for _, lang := range c.AcceptLanguages { bundleFilePath := fmt.Sprintf("%s.%s", lang.String(), c.FormatBundleFile) filepath := path.Join(c.RootPath, bundleFilePath) @@ -66,7 +64,6 @@ func (c *Config) initLocalizerMap() { c.mu.Lock() c.localizerMap = localizerMap c.mu.Unlock() - } /* From 0fc2872731fb0b16361828a5c46daa9c66a4b4d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Werner?= Date: Tue, 5 Sep 2023 10:14:00 +0200 Subject: [PATCH 15/16] correct method signature --- fiberi18n/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fiberi18n/README.md b/fiberi18n/README.md index da4404f8..6085548a 100644 --- a/fiberi18n/README.md +++ b/fiberi18n/README.md @@ -25,11 +25,11 @@ go get -u github.com/gofiber/contrib/fiberi18n/v2 ## Signature -| Name | Signature | Description | -|--------------|--------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------| -| New | `New(config ...*fiberi18n.Config) fiber.Handler` | Create a new fiberi18n middleware handler | -| Localize | `Localize(ctx *fiber.Ctx, params interface{}) (string, error)` | Localize returns a localized message. param is one of these type: messageID, *i18n.LocalizeConfig | -| MustLocalize | `MustLocalize(ctx *fiber.Ctx, params interface{}) (string, error)` | MustLocalize is similar to Localize, except it panics if an error happens. param is one of these type: messageID, *i18n.LocalizeConfig | +| Name | Signature | Description | +|--------------|----------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------| +| New | `New(config ...*fiberi18n.Config) fiber.Handler` | Create a new fiberi18n middleware handler | +| Localize | `Localize(ctx *fiber.Ctx, params interface{}) (string, error)` | Localize returns a localized message. param is one of these type: messageID, *i18n.LocalizeConfig | +| MustLocalize | `MustLocalize(ctx *fiber.Ctx, params interface{}) string` | MustLocalize is similar to Localize, except it panics if an error happens. param is one of these type: messageID, *i18n.LocalizeConfig | ## Config From 3f4576a860da4119eaaa62f044f564eac3a112f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Werner?= Date: Tue, 5 Sep 2023 10:18:40 +0200 Subject: [PATCH 16/16] outsource the locals key --- fiberi18n/i18n.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fiberi18n/i18n.go b/fiberi18n/i18n.go index 122b400c..9e41c1df 100644 --- a/fiberi18n/i18n.go +++ b/fiberi18n/i18n.go @@ -10,6 +10,8 @@ import ( "github.com/nicksnyder/go-i18n/v2/i18n" ) +const localsKey = "fiberi18n" + // New creates a new middleware handler func New(config ...*Config) fiber.Handler { cfg := configDefault(config...) @@ -25,7 +27,7 @@ func New(config ...*Config) fiber.Handler { if cfg.Next != nil && cfg.Next(c) { return c.Next() } - c.Locals("fiberi18n", cfg) + c.Locals(localsKey, cfg) return c.Next() } } @@ -101,7 +103,7 @@ Localize get the i18n message }) */ func Localize(ctx *fiber.Ctx, params interface{}) (string, error) { - appCfg := ctx.Locals("fiberi18n").(*Config) + appCfg := ctx.Locals(localsKey).(*Config) lang := appCfg.LangHandler(ctx, appCfg.DefaultLanguage.String()) localizer, _ := appCfg.localizerMap.Load(lang)