fix unhandled errors and remove unused parameter (#2061)

* 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
pull/2064/head
Amir Hossein 2022-08-30 11:08:16 +04:30 committed by GitHub
parent 0ebc9113d5
commit 349772d69a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -166,12 +166,18 @@ func captureOutput(f func()) string {
go func() {
var buf bytes.Buffer
wg.Done()
io.Copy(&buf, reader)
_, err := io.Copy(&buf, reader)
if err != nil {
panic(err)
}
out <- buf.String()
}()
wg.Wait()
f()
writer.Close()
err = writer.Close()
if err != nil {
panic(err)
}
return <-out
}
@ -244,6 +250,6 @@ func Test_App_print_Route_with_group(t *testing.T) {
utils.AssertEqual(t, true, strings.Contains(printRoutesMessage, "/v1/test/fiber/*"))
}
func emptyHandler(c *Ctx) error {
func emptyHandler(_ *Ctx) error {
return nil
}