You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> go test --run TestGeneric -v
=== RUN TestGeneric
0
--- PASS: TestGeneric (0.00s)
In my opinion, the return value of genericParseType should include an error. Functions like Query, Params, and GetReqHeader use genericParseType, but there is no error handling when parsing unexpected values.
Alignment with Express API
None
HTTP RFC Standards Compliance
None
API Stability
None
Feature Examples
funcgenericParseType[VGenericType](strstring, vV, defaultValue...V) (V, error)
funcGetReqHeader[VGenericType](cCtx, keystring, defaultValue...V) (V, error)
funcParams[VGenericType](cCtx, keystring, defaultValue...V) (V, error)
funcQuery[VGenericType](cCtx, keystring, defaultValue...V) (V, error)
// If `defaultValue` is not set and a parsing error occurs, an error should be returned.
Feature Proposal Description
When
genericParseType
encounters a parsing error and no default value is set, it silently sets the zero value without returning an error or panicking.In my opinion, the return value of
genericParseType
should include anerror
. Functions likeQuery
,Params
, andGetReqHeader
usegenericParseType
, but there is no error handling when parsing unexpected values.Alignment with Express API
None
HTTP RFC Standards Compliance
None
API Stability
None
Feature Examples
Checklist:
The text was updated successfully, but these errors were encountered: