Skip to content

Commit

Permalink
refactor: refactor codebase for improved maintainability
Browse files Browse the repository at this point in the history
- Add a `donothing` variable of type `cleanup` in `graceful.go`
- Remove the `donothing` function definition from `options.go`

Signed-off-by: appleboy <[email protected]>
  • Loading branch information
appleboy committed Nov 30, 2024
1 parent 7db56d9 commit 2e68240
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions graceful.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ type listenAndServe func() error
// cleanup is a function type that performs cleanup operations.
type cleanup func()

var donothing cleanup = func() {}

// Default returns a Graceful gin instance with the Logger and Recovery middleware already attached.
func Default(opts ...Option) (*Graceful, error) {
return New(gin.Default(), opts...)
Expand Down
2 changes: 0 additions & 2 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,3 @@ func listen(g *Graceful, l net.Listener, close cleanup) (listenAndServe, cleanup
close()
}, nil
}

func donothing() {}

0 comments on commit 2e68240

Please sign in to comment.