Skip to content

Commit 759ac16

Browse files
committed
chore: upgraded dependencies
1 parent 90a20e3 commit 759ac16

File tree

12 files changed

+58
-47
lines changed

12 files changed

+58
-47
lines changed

.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ linters:
147147
- protobuf
148148

149149
dupl:
150-
threshold: 100
150+
threshold: 200
151151

152152
nestif:
153-
min-complexity: 4
153+
min-complexity: 5
154154

155155
nilnil:
156156
only-two: true

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ go 1.25.1
44

55
require (
66
github.com/ralvarezdev/go-flags v0.3.8
7-
github.com/ralvarezdev/go-grpc v0.5.12
8-
github.com/ralvarezdev/go-json v0.1.3
7+
github.com/ralvarezdev/go-grpc v0.5.13
8+
github.com/ralvarezdev/go-json v0.2.1
99
github.com/ralvarezdev/go-jwt v0.7.4
1010
github.com/ralvarezdev/go-rate-limiter v0.1.11
11-
github.com/ralvarezdev/go-reflect v0.2.12
12-
github.com/ralvarezdev/go-strings v0.1.17
13-
github.com/ralvarezdev/go-validator v0.6.20
11+
github.com/ralvarezdev/go-reflect v0.3.1
12+
github.com/ralvarezdev/go-strings v0.2.1
13+
github.com/ralvarezdev/go-validator v0.7.3
1414
google.golang.org/genproto/googleapis/rpc v0.0.0-20251029180050-ab9386a59fda
1515
google.golang.org/grpc v1.76.0
1616
)

go.sum

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,24 @@ github.com/ralvarezdev/go-databases v0.8.2 h1:rcQOvhzy5vFpTGDo/O7ar3EuxSxbgu8CFc
2222
github.com/ralvarezdev/go-databases v0.8.2/go.mod h1:f5HsXMi89hSenuZM88IKmfqdTv2gI1JBxizKukz/Y9A=
2323
github.com/ralvarezdev/go-flags v0.3.8 h1:b/doNRr2HsniEpz8NjbH2vxJH5WMeymIx0LAzDIOnOc=
2424
github.com/ralvarezdev/go-flags v0.3.8/go.mod h1:R3yVBYvzwqfOp26LidaiJ/zftVAnPC3pKunVpV/vosE=
25-
github.com/ralvarezdev/go-grpc v0.5.12 h1:x2gqx3FSwQBCx6ti8T8PpidmSVwGg7g5BYSBRW8RzSs=
26-
github.com/ralvarezdev/go-grpc v0.5.12/go.mod h1:eW0pAyGAckM1Y+dZ4A1ARDBWTWGnLRHZn0tUb9ifHS0=
25+
github.com/ralvarezdev/go-grpc v0.5.13 h1:YVqp4IjNUdte0KolRUl42tps+JNOeo+kNH0OJrzTW6g=
26+
github.com/ralvarezdev/go-grpc v0.5.13/go.mod h1:S3qX1G9vyKoauyXVA+zWHOH3aVhSK02lzywnC7qsXxA=
2727
github.com/ralvarezdev/go-json v0.1.3 h1:Z+eVzJkDLXg9P07w6iBVUG5vm0iVl7wHbi/Guoil9H8=
2828
github.com/ralvarezdev/go-json v0.1.3/go.mod h1:NRhaU538nV65bKQcotfZkN57aHFftLHvV24wTWSv2MQ=
29+
github.com/ralvarezdev/go-json v0.2.0 h1:YvcR2vCZbvmVC1dvIgD34M5YjdzE2AjVQoyDJ5tqA28=
30+
github.com/ralvarezdev/go-json v0.2.0/go.mod h1:eH6UIUzom6P+Pn9G6yiiTVQUPvEkm8JYe3oPZvBbaL4=
31+
github.com/ralvarezdev/go-json v0.2.1 h1:4RHPeU04X899Zv9XNIawk28nnczEwv7rYlWeQGRhIoU=
32+
github.com/ralvarezdev/go-json v0.2.1/go.mod h1:eH6UIUzom6P+Pn9G6yiiTVQUPvEkm8JYe3oPZvBbaL4=
2933
github.com/ralvarezdev/go-jwt v0.7.4 h1:f9ovJubB/X1xL1cxeW+QNQ8y79Jh/YN9v74SiyYBYXY=
3034
github.com/ralvarezdev/go-jwt v0.7.4/go.mod h1:fXGHJ6oPHXgMNWlgR08emuxUklQKgEqgWsq69Jk7lDE=
3135
github.com/ralvarezdev/go-rate-limiter v0.1.11 h1:4YqXf8iOuwsGi5oCAwJSHAjq7xRlbbCPiLrg2b2kJtw=
3236
github.com/ralvarezdev/go-rate-limiter v0.1.11/go.mod h1:TcADAW+bEUJhNtfdg9kaRYn0tp4laJrrMJcaB+zP7HY=
33-
github.com/ralvarezdev/go-reflect v0.2.12 h1:Bttzr/oxXLaaKm9fPIfDsZuFfMQsPw/VJijCml2FD60=
34-
github.com/ralvarezdev/go-reflect v0.2.12/go.mod h1:CsZqMmJCXYow9l2YQIdvIe/q7aeRtlA3gq0r9dmLEN0=
35-
github.com/ralvarezdev/go-strings v0.1.17 h1:HFFqe5fVqsYdaOsj+yoVtgIgkNXubDHSz5ubN8V6iW8=
36-
github.com/ralvarezdev/go-strings v0.1.17/go.mod h1:8sFOqmPJpqzS7bTjf91EzUCITnwpmkfifwY80GxV5r8=
37-
github.com/ralvarezdev/go-validator v0.6.20 h1:ufTsFSL49tfXatE/baLnTa1D3+rCrZbNNmpatUkgOfU=
38-
github.com/ralvarezdev/go-validator v0.6.20/go.mod h1:vqU4jUOxGyDDH0eMS+Lg8H0yKOjEsFPJrFw1KMJQw4w=
37+
github.com/ralvarezdev/go-reflect v0.3.1 h1:+u59QNddIwI0lQWhWqO5gYGKC4oR0DP50uEpLxwdS/4=
38+
github.com/ralvarezdev/go-reflect v0.3.1/go.mod h1:CsZqMmJCXYow9l2YQIdvIe/q7aeRtlA3gq0r9dmLEN0=
39+
github.com/ralvarezdev/go-strings v0.2.1 h1:bWq0bzzGrPfCrdK5ptUT6+xTMuvvXQ0Q3fARFWV/7AY=
40+
github.com/ralvarezdev/go-strings v0.2.1/go.mod h1:8sFOqmPJpqzS7bTjf91EzUCITnwpmkfifwY80GxV5r8=
41+
github.com/ralvarezdev/go-validator v0.7.3 h1:luAeMag4e4+YF1Yir2X2UMrmU2F+YdnTqyIkoeFFvVI=
42+
github.com/ralvarezdev/go-validator v0.7.3/go.mod h1:ZRRgq75OCAMRsiL8/Xlq0zHaUSEq6A3zmEgvSoOLFfs=
3943
golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04=
4044
golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
4145
golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4=

http/middleware/auth/grpc/middleware.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ func (m Middleware) AuthenticateFromHeader(
126126
rpcMethod,
127127
)
128128
}
129-
129+
130130
// Check if the authentication is needed
131131
if token != nil {
132132
return m.authenticator.AuthenticateFromHeader(
133133
*token,
134134
)
135135
}
136-
136+
137137
// If no authentication is needed, return a no-op middleware
138138
return func(next http.Handler) http.Handler {
139139
return http.HandlerFunc(
@@ -171,7 +171,7 @@ func (m Middleware) AuthenticateFromCookie(
171171
*token,
172172
)
173173
}
174-
174+
175175
// If no authentication is needed, return a no-op middleware
176176
return func(next http.Handler) http.Handler {
177177
return http.HandlerFunc(

http/middleware/validator/middleware.go

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func NewMiddleware(
5151
if requestsHandler == nil {
5252
return nil, gonethttphandler.ErrNilHandler
5353
}
54-
54+
5555
// Check if the generator is nil
5656
if generator == nil {
5757
return nil, govalidatormapper.ErrNilGenerator
@@ -96,15 +96,16 @@ func NewMiddleware(
9696
// NewJSONMiddleware creates a new Middleware instance for JSON requests
9797
//
9898
// Parameters:
99-
//
100-
// - requestsHandler: The HTTP handler to parse the request body
101-
// - birthdateOptions: The birthdate options (can be nil)
102-
// - passwordOptions: The password options (can be nil)
103-
// - logger: The logger (can be nil)
104-
//
99+
//
100+
// - requestsHandler: The HTTP handler to parse the request body
101+
// - birthdateOptions: The birthdate options (can be nil)
102+
// - passwordOptions: The password options (can be nil)
103+
// - logger: The logger (can be nil)
104+
//
105105
// Returns:
106-
//
107-
// - *Middleware: The middleware instance
106+
//
107+
// - *Middleware: The middleware instance
108+
//
108109
// - error: The error if any
109110
func NewJSONMiddleware(
110111
requestsHandler gonethttphandler.RequestsHandler,
@@ -128,14 +129,14 @@ func NewJSONMiddleware(
128129
// NewProtoJSONMiddleware creates a new Middleware instance for ProtoJSON requests
129130
//
130131
// Parameters:
131-
//
132+
//
132133
// - requestsHandler: The HTTP handler to parse the request body
133134
// - birthdateOptions: The birthdate options (can be nil)
134135
// - passwordOptions: The password options (can be nil)
135136
// - logger: The logger (can be nil)
136-
//
137+
//
137138
// Returns:
138-
//
139+
//
139140
// - *Middleware: The middleware instance
140141
// - error: The error if any
141142
func NewProtoJSONMiddleware(
@@ -146,7 +147,7 @@ func NewProtoJSONMiddleware(
146147
) (*Middleware, error) {
147148
// Create the ProtoJSON mapper generator
148149
generator := govalidatormapper.NewProtobufGenerator(logger)
149-
150+
150151
// Create the middleware
151152
return NewMiddleware(
152153
requestsHandler,
@@ -169,10 +170,10 @@ func NewProtoJSONMiddleware(
169170
// - error: if there was an error creating the mapper
170171
func (m Middleware) createMapper(
171172
structInstance any,
172-
) (*govalidatormapper.Mapper, reflect.Type, error) {
173+
) (*govalidatormapper.Mapper, reflect.Type, error) {
173174
// Get the type of the request
174175
structInstanceType := goreflect.GetDereferencedType(structInstance)
175-
176+
176177
// Create the mapper
177178
mapper, err := m.generator.NewMapper(structInstance)
178179
if err != nil {
@@ -295,4 +296,4 @@ func (m Middleware) Validate(
295296
panic(err)
296297
}
297298
return validateFn
298-
}
299+
}

http/request/protojson/decoder.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ type (
2424
//
2525
// - *Decoder: The decoder instance
2626
func NewDecoder() *Decoder {
27+
// Create the ProtoJSON decoder options
28+
options := gojsondecoderprotojson.NewOptions(true)
29+
2730
// Create the JSON decoder
28-
decoder := gojsondecoderprotojson.NewDecoder()
31+
decoder := gojsondecoderprotojson.NewDecoder(options)
2932

3033
return &Decoder{
3134
decoder: decoder,

http/response/handler/jsend/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (r RawErrorHandler) HandleRawError(
8888
if r.logger == nil {
8989
return
9090
}
91-
91+
9292
// Build the full request URL
9393
url := req.URL
9494
var fullURL string
@@ -97,7 +97,7 @@ func (r RawErrorHandler) HandleRawError(
9797
} else {
9898
fullURL = fmt.Sprintf("%s://%s%s", "http", req.Host, url.RequestURI())
9999
}
100-
100+
101101
if stackTrace != nil {
102102
r.logger.Error(
103103
"An unhandled error caught in RawErrorHandler",

http/response/jsend/grpc/fail.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,4 +344,4 @@ func NewFailDataErrorFromErrorDetailsLocalizedMessage(
344344
ErrCodeLocalizedMessage,
345345
http.StatusBadRequest,
346346
)
347-
}
347+
}

http/response/protojson/encoder.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ type (
3535
func NewEncoder(
3636
mode *goflagsmode.Flag,
3737
) *Encoder {
38+
// Define the ProtoJSON encoder options
39+
options := gojsonencoderprotojson.NewOptions(true)
40+
3841
// Initialize the ProtoJSON encoder
39-
protoJSONEncoder := gojsonencoderprotojson.NewEncoder()
42+
protoJSONEncoder := gojsonencoderprotojson.NewEncoder(options)
4043

4144
// Initialize the JSON encoder
4245
jsonEncoder := gonethttpresponsejson.NewEncoder(

http/route/errors.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const (
1111
)
1212

1313
var (
14-
ErrNilRouter = errors.New("router cannot be nil")
15-
ErrEmptyPattern = errors.New("pattern cannot be empty")
16-
ErrEmptyWildcard = errors.New("wildcard cannot be empty")
14+
ErrNilRouter = errors.New("router cannot be nil")
15+
ErrEmptyPattern = errors.New("pattern cannot be empty")
16+
ErrEmptyWildcard = errors.New("wildcard cannot be empty")
1717
ErrWildcardNotClosed = errors.New("wildcard not closed")
1818
)

0 commit comments

Comments
 (0)