mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 12:51:22 +00:00
linting: apply errcheck part1
This commit is contained in:
committed by
Ethan Buchman
parent
d95ba866b8
commit
57ea4987f7
@ -29,7 +29,9 @@ func UnsafeStartCPUProfiler(filename string) (*ctypes.ResultUnsafeProfile, error
|
||||
|
||||
func UnsafeStopCPUProfiler() (*ctypes.ResultUnsafeProfile, error) {
|
||||
pprof.StopCPUProfile()
|
||||
profFile.Close()
|
||||
if err := profFile.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &ctypes.ResultUnsafeProfile{}, nil
|
||||
}
|
||||
|
||||
@ -38,8 +40,12 @@ func UnsafeWriteHeapProfile(filename string) (*ctypes.ResultUnsafeProfile, error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pprof.WriteHeapProfile(memProfFile)
|
||||
memProfFile.Close()
|
||||
if err := pprof.WriteHeapProfile(memProfFile); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := memProfFile.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &ctypes.ResultUnsafeProfile{}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user