Skip to content

Commit

Permalink
update code comments for helping IDEs and fix unhandled error in test (
Browse files Browse the repository at this point in the history
…#2099)

* fix unhandled errors

* fix unhandled error in cache package test

* omit variable type

* omit variable type

* rename variable because collide with the imported package name

* handle file error on closing

* fix unhandled in common_linux.go

* fix unhandled errors in helpers_test.go

* fix unhandled errors in listen_test.go

* remove unused parameter in emptyHandler method

* refactor path.go

* unhandled error in hooks test

* fix unhandled errors in app_test.go

* fix unhandled errors in ctx_test.go

* ✨ fix unhandled errors in helpers_test.go

* revert app_test.go

* remove redundant parentheses and update comments

* update code comment for helping ide

* update code comment for helping ide

* fix unhandled error in app_test.go

* update code comments for helping IDEs
  • Loading branch information
Kamandlou authored Sep 18, 2022
1 parent 7c83e38 commit 1d773c7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,8 @@ func Benchmark_App_ETag(b *testing.B) {
app := New()
c := app.AcquireCtx(&fasthttp.RequestCtx{})
defer app.ReleaseCtx(c)
c.Send([]byte("Hello, World!"))
err := c.Send([]byte("Hello, World!"))
utils.AssertEqual(b, nil, err)
for n := 0; n < b.N; n++ {
setETag(c, false)
}
Expand Down
2 changes: 1 addition & 1 deletion ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ func (c *Ctx) Redirect(location string, status ...int) error {
return nil
}

// Add vars to default view var map binding to template engine.
// Bind Add vars to default view var map binding to template engine.
// Variables are read by the Render method and may be overwritten.
func (c *Ctx) Bind(vars Map) error {
// init viewBindMap - lazy map
Expand Down
2 changes: 1 addition & 1 deletion group.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (grp *Group) Mount(prefix string, fiber *App) Router {
return grp
}

// Assign name to specific route.
// Name Assign name to specific route.
func (grp *Group) Name(name string) Router {
grp.app.mutex.Lock()
if strings.HasPrefix(grp.Prefix, grp.app.latestGroup.Prefix) {
Expand Down
2 changes: 1 addition & 1 deletion hooks.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package fiber

// Handlers define a function to create hooks for Fiber.
// OnRouteHandler Handlers define a function to create hooks for Fiber.
type OnRouteHandler = func(Route) error
type OnNameHandler = OnRouteHandler
type OnGroupHandler = func(Group) error
Expand Down

1 comment on commit 1d773c7

@ReneWerner87
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 1d773c7 Previous: bc03ebf Ratio
Benchmark_StatusMessage/default 10.86 ns/op 0 B/op 0 allocs/op 4.019 ns/op 0 B/op 0 allocs/op 2.70

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.