gin-gonic / gin

Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
https://gin-gonic.com/
MIT License
76.76k stars 7.92k forks source link

[Help] indirect require package [github.com/go-playground/locales] too big #3165

Open Laotree opened 2 years ago

Laotree commented 2 years ago

Description

I use gin as my web framework. everytime I packup my binary file, in a pure container, it always cost too much time to download locales package since gin which less than 3M, requires locales indirectly, I repeatly download which more than 30M could gin remove locales or replace it with a smaller requirement?

go mod why github.com/go-playground/locales                                                                                                                                                         
# github.com/go-playground/locales
github.com/gin-gonic/gin/binding
github.com/go-playground/validator/v10
github.com/go-playground/universal-translator
github.com/go-playground/locales
thinkerou commented 2 years ago

maybe commit issue to here: https://github.com/go-playground/validator/issues

Laotree commented 2 years ago

maybe commit issue to here: https://github.com/go-playground/validator/issues

Validation is self-defined in beego , so I think if there is a option for gin to build its own validation package? For now, it's not a graceful solution to require locales indirectly, considering its size and only used in validation. Strongly suggest you guys think about it.