mirror of https://github.com/gofiber/fiber.git
fix unhandled error in `common_linux.go` (#2056)
* 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.gopull/2058/head
parent
b86f79eca4
commit
506f0b21c5
|
@ -6,6 +6,7 @@ package common
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
@ -37,7 +38,12 @@ func NumProcs() (uint64, error) {
|
|||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
defer f.Close()
|
||||
defer func(f *os.File) {
|
||||
err := f.Close()
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
}(f)
|
||||
|
||||
list, err := f.Readdirnames(-1)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue