mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-21 06:33:11 +00:00
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.go
This commit is contained in:
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…
x
Reference in New Issue
Block a user