Apply linter autofixes: cmd/vaultik (refs #61)
This commit is contained in:
@@ -16,9 +16,11 @@ func main() {
|
|||||||
panic("could not create CPU profile: " + err.Error())
|
panic("could not create CPU profile: " + err.Error())
|
||||||
}
|
}
|
||||||
defer func() { _ = f.Close() }()
|
defer func() { _ = f.Close() }()
|
||||||
|
|
||||||
if err := pprof.StartCPUProfile(f); err != nil {
|
if err := pprof.StartCPUProfile(f); err != nil {
|
||||||
panic("could not start CPU profile: " + err.Error())
|
panic("could not start CPU profile: " + err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
defer pprof.StopCPUProfile()
|
defer pprof.StopCPUProfile()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,7 +32,9 @@ func main() {
|
|||||||
panic("could not create memory profile: " + err.Error())
|
panic("could not create memory profile: " + err.Error())
|
||||||
}
|
}
|
||||||
defer func() { _ = f.Close() }()
|
defer func() { _ = f.Close() }()
|
||||||
|
|
||||||
runtime.GC() // get up-to-date statistics
|
runtime.GC() // get up-to-date statistics
|
||||||
|
|
||||||
if err := pprof.WriteHeapProfile(f); err != nil {
|
if err := pprof.WriteHeapProfile(f); err != nil {
|
||||||
panic("could not write memory profile: " + err.Error())
|
panic("could not write memory profile: " + err.Error())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user