-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π fix: Nil pointer dereference with Must Bind binding (#3171)
* Fix nil pointer dereference with Must Bind binding error if err is nil err.Error() panics (eg. c.Bind().Must().JSON(...) successfully binds but panics * Added returnErr test make sure returnErr works with nil error * Reordered returnErr nil check as in majority of cases we expect err to be nil, this should provide better short-cutting * Use require.NoError * Update bind_test.go * Renamed Must to WithAutoHandling * Update bind.md Added a requested clarification * renamed Should to WithoutAutoHandling and Bind.should to Bind.dontHandle * renamed dontHandle to dontHandleErrs * fixed formatting * fixed a typo * Update binder documentation --------- Co-authored-by: Juan Calderon-Perez <[email protected]>
- Loading branch information
1 parent
f8b490f
commit f08ebf4
Showing
5 changed files
with
107 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
f08ebf4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.50
.Benchmark_Ctx_Send
6.513
ns/op 0 B/op 0 allocs/op4.335
ns/op 0 B/op 0 allocs/op1.50
Benchmark_Ctx_Send - ns/op
6.513
ns/op4.335
ns/op1.50
Benchmark_Utils_GetOffer/1_parameter
202.9
ns/op 0 B/op 0 allocs/op131
ns/op 0 B/op 0 allocs/op1.55
Benchmark_Utils_GetOffer/1_parameter - ns/op
202.9
ns/op131
ns/op1.55
Benchmark_Middleware_BasicAuth - B/op
80
B/op48
B/op1.67
Benchmark_Middleware_BasicAuth - allocs/op
5
allocs/op3
allocs/op1.67
Benchmark_Middleware_BasicAuth_Upper - B/op
80
B/op48
B/op1.67
Benchmark_Middleware_BasicAuth_Upper - allocs/op
5
allocs/op3
allocs/op1.67
Benchmark_CORS_NewHandler - B/op
16
B/op0
B/op+β
Benchmark_CORS_NewHandler - allocs/op
1
allocs/op0
allocs/op+β
Benchmark_CORS_NewHandlerSingleOrigin - B/op
16
B/op0
B/op+β
Benchmark_CORS_NewHandlerSingleOrigin - allocs/op
1
allocs/op0
allocs/op+β
Benchmark_CORS_NewHandlerPreflight - B/op
104
B/op0
B/op+β
Benchmark_CORS_NewHandlerPreflight - allocs/op
5
allocs/op0
allocs/op+β
Benchmark_CORS_NewHandlerPreflightSingleOrigin - B/op
104
B/op0
B/op+β
Benchmark_CORS_NewHandlerPreflightSingleOrigin - allocs/op
5
allocs/op0
allocs/op+β
Benchmark_CORS_NewHandlerPreflightWildcard - B/op
104
B/op0
B/op+β
Benchmark_CORS_NewHandlerPreflightWildcard - allocs/op
5
allocs/op0
allocs/op+β
Benchmark_Middleware_CSRF_GenerateToken - B/op
516
B/op327
B/op1.58
Benchmark_Middleware_CSRF_GenerateToken - allocs/op
10
allocs/op6
allocs/op1.67
This comment was automatically generated by workflow using github-action-benchmark.